Skip to content

Commit 55d1f40

Browse files
authored
Merge pull request #470 from OpenLiberty/staging
Merge staging to prod - Update to use maven wrapper
2 parents 66d78aa + 81fb337 commit 55d1f40

File tree

13 files changed

+1277
-38
lines changed

13 files changed

+1277
-38
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
VALIDATE_CSS: false
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
LINTER_RULES_PATH: ./tools/pr-checker/linters/
33+
FILTER_REGEX_EXCLUDE: mvnw*
3334
DEFAULT_BRANCH: prod
3435
- name: Summary
3536
if: "! github.event.pull_request.head.repo.fork"

README.adoc

Lines changed: 186 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,36 @@ include::finish/pom.xml[]
7878

7979
To begin, navigate to the `start` directory. Build the `system` microservice that is provided and deploy it to Open Liberty by running the Maven `liberty:run` goal:
8080

81+
include::{common-includes}/os-tabs.adoc[]
82+
83+
[.tab_content.windows_section]
84+
--
85+
[role='command']
86+
```
87+
cd start
88+
mvnw.cmd liberty:run
89+
```
90+
--
91+
92+
[.tab_content.mac_section]
93+
--
8194
[role='command']
8295
```
8396
cd start
84-
mvn liberty:run
97+
./mvnw liberty:run
8598
```
99+
--
86100

87-
The `mvn` command initiates a Maven build, during which the `target` directory is created to store all build-related files.
101+
[.tab_content.linux_section]
102+
--
103+
[role='command']
104+
```
105+
cd start
106+
./mvnw liberty:run
107+
```
108+
--
109+
110+
The Maven command initiates a Maven build, during which the `target` directory is created to store all build-related files.
88111

89112
The `liberty:run` argument specifies the Open Liberty `run` goal, which starts an Open Liberty instance in the foreground. As part of this phase, an Open Liberty runtime is downloaded and installed into the `target/liberty/wlp` directory, an instance of Liberty is created and configured in the `target/liberty/wlp/usr/servers/defaultServer` directory, and the application is installed into that instance using https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_loose_applications.html[loose config^].
90113

@@ -110,10 +133,31 @@ To access the `system` microservice, see the http://localhost:9080/system/proper
110133

111134
When you need to stop the Liberty instance, press `CTRL+C` in the command-line session where you ran Liberty, or run the `liberty:stop` goal from the `start` directory in another command-line session:
112135

136+
include::{common-includes}/os-tabs.adoc[]
137+
138+
[.tab_content.windows_section]
139+
--
140+
[role='command']
141+
```
142+
mvnw.cmd liberty:stop
143+
```
144+
--
145+
146+
[.tab_content.mac_section]
147+
--
148+
[role='command']
149+
```
150+
./mvnw liberty:stop
151+
```
152+
--
153+
154+
[.tab_content.linux_section]
155+
--
113156
[role='command']
114157
```
115-
mvn liberty:stop
158+
./mvnw liberty:stop
116159
```
160+
--
117161

118162
// =================================================================================================
119163
// Starting and stopping Open Liberty in the background
@@ -123,11 +167,35 @@ mvn liberty:stop
123167

124168
Although you can start and stop Liberty in the foreground by using the Maven `liberty:run` goal, you can also start and stop the Liberty instance in the background with the Maven `liberty:start` and `liberty:stop` goals:
125169

170+
include::{common-includes}/os-tabs.adoc[]
171+
172+
[.tab_content.windows_section]
173+
--
126174
[role='command']
127-
----
128-
mvn liberty:start
129-
mvn liberty:stop
130-
----
175+
```
176+
mvnw.cmd liberty:start
177+
mvnw.cmd liberty:stop
178+
```
179+
--
180+
181+
[.tab_content.mac_section]
182+
--
183+
[role='command']
184+
```
185+
./mvnw liberty:start
186+
./mvnw liberty:stop
187+
```
188+
--
189+
190+
[.tab_content.linux_section]
191+
--
192+
[role='command']
193+
```
194+
./mvnw liberty:start
195+
./mvnw liberty:stop
196+
```
197+
198+
--
131199

132200

133201
// =================================================================================================
@@ -140,10 +208,32 @@ The Open Liberty Maven plug-in includes a `dev` goal that listens for any change
140208

141209
Stop the Open Liberty instance if it is running, and start it in https://openliberty.io/docs/latest/development-mode.html[dev mode^] by running the `liberty:dev` goal in the `start` directory:
142210

211+
include::{common-includes}/os-tabs.adoc[]
212+
213+
[.tab_content.windows_section]
214+
--
143215
[role='command']
144216
```
145-
mvn liberty:dev
217+
mvnw.cmd liberty:dev
146218
```
219+
--
220+
221+
[.tab_content.mac_section]
222+
--
223+
[role='command']
224+
```
225+
./mvnw liberty:dev
226+
```
227+
--
228+
229+
[.tab_content.linux_section]
230+
--
231+
[role='command']
232+
```
233+
./mvnw liberty:dev
234+
```
235+
236+
--
147237

148238
Dev mode automatically picks up changes that you make to your application and allows you to run tests by pressing the `enter/return` key in the active command-line session. When you’re working on your application, rather than rerunning Maven commands, press the `enter/return` key to verify your change.
149239

@@ -190,8 +280,8 @@ Try to access the `/health` endpoint again by visiting the http://localhost:9080
190280
[source, JSON, role="no_copy"]
191281
----
192282
{
193-
"checks":[],
194-
"status":"UP"
283+
"status":"UP",
284+
"checks":[]
195285
}
196286
----
197287

@@ -264,26 +354,26 @@ Access the `/health` endpoint again by going to the http://localhost:9080/health
264354

265355
[source, JSON, role="no_copy"]
266356
----
267-
{
268-
"checks":[
269-
{
270-
"data":{},
271-
"name":"SystemResource Readiness Check",
272-
"status":"UP"
273-
},
274-
{
275-
"data":{},
276-
"name":"SystemResource Liveness Check",
277-
"status":"UP"
278-
}
279-
],
280-
"status":"UP"
357+
{
358+
"status": "UP",
359+
"checks": [
360+
{
361+
"name": "SystemResource Liveness Check",
362+
"status": "UP",
363+
"data": {}
364+
},
365+
{
366+
"name": "SystemResource Readiness Check",
367+
"status": "UP",
368+
"data": {}
369+
}
370+
]
281371
}
282372
----
283373

284374
You can also access the `/health/ready` endpoint by going to the http://localhost:9080/health/ready[http://localhost:9080/health/ready^] URL to view the data from the readiness health check. Similarly, access the `/health/live` endpoint by going to the http://localhost:9080/health/live[http://localhost:9080/health/live^] URL to view the data from the liveness health check.
285375

286-
Making code changes and recompiling is fast and straightforward. Open Liberty dev mode automatically picks up changes in the `.class` files and artifacts, without needing to be restarted. Alternatively, you can run the `run` goal and manually repackage or recompile the application by using the `mvn package` command or the `mvn compile` command while Liberty is running. Dev mode was added to further improve the developer experience by minimizing turnaround times.
376+
Making code changes and recompiling is fast and straightforward. Open Liberty dev mode automatically picks up changes in the `.class` files and artifacts, without needing to be restarted. Alternatively, you can run the `run` goal and manually repackage or recompile the application by using the Maven `package` goal or the Maven `compile` goal while Liberty is running. Dev mode was added to further improve the developer experience by minimizing turnaround times.
287377

288378

289379
// =================================================================================================
@@ -346,13 +436,34 @@ endif::[]
346436

347437
To containerize the application, you need a `Dockerfile`. This file contains a collection of instructions that define how a Docker image is built, what files are packaged into it, what commands run when the image runs as a container, and other information. You can find a complete `Dockerfile` in the `start` directory. This `Dockerfile` copies the `.war` file into a Docker image that contains the Java runtime and a preconfigured Open Liberty runtime.
348438

349-
Run the `mvn package` command from the `start` directory so that the `.war` file resides in the `target` directory.
439+
Run the Maven `package` goal from the `start` directory so that the `.war` file resides in the `target` directory.
440+
441+
include::{common-includes}/os-tabs.adoc[]
350442

443+
[.tab_content.windows_section]
444+
--
351445
[role='command']
352446
```
353-
mvn package
447+
mvnw.cmd package
354448
```
449+
--
355450

451+
[.tab_content.mac_section]
452+
--
453+
[role='command']
454+
```
455+
./mvnw package
456+
```
457+
--
458+
459+
[.tab_content.linux_section]
460+
--
461+
[role='command']
462+
```
463+
./mvnw package
464+
```
465+
466+
--
356467

357468

358469
To build and containerize the application, run the following Docker build command in the `start` directory:
@@ -435,17 +546,38 @@ Build and run the container by running the devc goal from the `start` directory:
435546

436547
// Static guide instruction
437548
ifndef::cloud-hosted[]
549+
include::{common-includes}/os-tabs.adoc[]
550+
551+
[.tab_content.windows_section]
552+
--
438553
[role='command']
439554
```
440-
mvn liberty:devc
555+
mvnw.cmd liberty:devc
441556
```
557+
--
558+
559+
[.tab_content.mac_section]
560+
--
561+
[role='command']
562+
```
563+
./mvnw liberty:devc
564+
```
565+
--
566+
567+
[.tab_content.linux_section]
568+
--
569+
[role='command']
570+
```
571+
./mvnw liberty:devc
572+
```
573+
--
442574
endif::[]
443575

444576
// Cloud hosted guide instruction
445577
ifdef::cloud-hosted[]
446578
```bash
447579
chmod 777 /home/project/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer/logs
448-
mvn liberty:devc -DserverStartTimeout=300
580+
./mvnw liberty:devc -DserverStartTimeout=300
449581
```
450582
endif::[]
451583

@@ -566,10 +698,34 @@ So far, Open Liberty was running out of the `target/liberty/wlp` directory, whic
566698
Open Liberty supports a number of different server packages. The sample application currently generates a `usr` package that contains the Liberty runtime and application to be extracted onto an Open Liberty installation.
567699

568700
Instead of creating a server package, you can generate a runnable JAR file that contains the application along with a Liberty runtime. This JAR file can then be run anywhere and deploy your application and runtime at the same time. To generate a runnable JAR file, override the `include` property:
701+
702+
include::{common-includes}/os-tabs.adoc[]
703+
704+
[.tab_content.windows_section]
705+
--
706+
[role='command']
707+
```
708+
mvnw.cmd liberty:package -Dinclude=runnable
709+
```
710+
--
711+
712+
[.tab_content.mac_section]
713+
--
569714
[role='command']
570715
```
571-
mvn liberty:package -Dinclude=runnable
716+
./mvnw liberty:package -Dinclude=runnable
572717
```
718+
--
719+
720+
[.tab_content.linux_section]
721+
--
722+
[role='command']
723+
```
724+
./mvnw liberty:package -Dinclude=runnable
725+
```
726+
727+
--
728+
573729

574730
The packaging type is overridden from the `usr` package to the `runnable` package. This property then propagates to the [hotspot=libertyMavenPlugin file=0]`liberty-maven-plugin` plug-in, which generates the server package based on the `openliberty-kernel` package.
575731

61.6 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

0 commit comments

Comments
 (0)