You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix maven-ear-plugin module URIs
* Move aggregating build section
* Re-arrange flow of the guide
* Fix filepaths
* Make "start/" consistent with "start"
* Add .gitkeep file for server config directory
* Replace Test.java with .gitkeep
* Re-arrange "mvn install" instructions
* Add hotspots for "jar", "war", and "ear"
* Make tags in README self-closing
* Remove sentence
Andrew mentioned it
Copy file name to clipboardExpand all lines: README.adoc
+70-72Lines changed: 70 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,6 @@ You will learn how to establish a dependency between a web module and a Java lib
35
35
36
36
You will build a unit converter application that converts heights from centimeters into feet and inches. Enter heights in centimeters from a web page, and the application processes the input with functions in the JAR file to return the corresponding height in Imperial units.
37
37
38
-
When the application is running, you can access the unit converter at the following location: http://localhost:9080/converter[http://localhost:9080/converter^]
@@ -123,7 +120,7 @@ Set the [hotspot=7-11 file=0]`basic configuration` for the project and set the [
123
120
124
121
The [hotspot=16-21 file=0]`Java library module` and the [hotspot=22-27 file=0]`web module` were added as dependencies. Specify [hotspot=26 file=0]`<type>war</type>` for the web module. If you don’t specify the web module, Maven looks for a JAR file.
125
122
126
-
The definition and configuration of the [hotspot=38-58 file=0]`maven-ear-plugin` plug-in were added to create an EAR file. Define the [hotspot=44-48 file=0]`<jarModule>` and [hotspot=49-55 file=0]`<webModule>` modules to be packaged into the EAR file.
123
+
The definition and configuration of the [hotspot=38-58 file=0]`maven-ear-plugin` plug-in were added to create an EAR file. Define the [hotspot=44-48 file=0]`<jarModule/>` and [hotspot=49-55 file=0]`<webModule/>` modules to be packaged into the EAR file.
127
124
To customize the context root of the application, set the appropriate contextRoot in the webModule. Otherwise, Maven automatically uses the WAR file `artifactId` ID as the context root for the application while generating the `application.xml` file.
128
125
129
126
To download and start an Open Liberty server, use the [hotspot=61-90 file=0]`liberty-maven-plugin` plug-in for Maven. This configuration is provided, and the executions of the plug-in follow the typical phases of a Maven life cycle.
Because you have multiple modules, aggregate the Maven projects to simplify the build process.
148
+
149
+
Create a parent `pom.xml` file under the `start` directory to link all of the child modules together. A template is provided for you.
150
+
151
+
[role="code_command hotspot", subs="quotes"]
152
+
----
153
+
#Replace the start/POM file.#
154
+
`pom.xml`
155
+
----
156
+
start/pom.xml
157
+
[source, xml, linenums, role='code_column']
158
+
----
159
+
include::finish/pom.xml[tags=**]
160
+
----
161
+
Set the [hotspot=13-17 file=0]`basic configuration` for the project. Set `pom` as the [hotspot=17 file=0]`<packaging/>` element of the parent `pom.xml` file. Specify `io.openliberty.guides` as the [hotspot=14 file=0]`<groupId/>` ID, which the child `pom.xml` files will inherit.
162
+
163
+
In the parent `pom.xml` file, list all of the [hotspot=19-23 file=0]`<modules/>` that you want to aggregate for the application.
164
+
165
+
Lastly,
166
+
167
+
[role="code_command hotspot", subs="quotes"]
168
+
----
169
+
#Update the `pom.xml` in the child module `jar`, `war` and `ear` projects.#
170
+
`jar/pom.xml`
171
+
`war/pom.xml`
172
+
`ear/pom.xml`
173
+
----
174
+
175
+
[role="edit_command_text"]
176
+
Add a [hotspot=1-5 file=1]`<parent/>` section just above `basic configuration` to each of the `pom.xml` files in the child modules,
177
+
such as the [hotspot=9-13 file=2]`jar`, [hotspot=14-19 file=3]`war`, and [hotspot=13-17 file=4]`ear` projects.
To build the three modules, run the following commands from the `jar` directory, `war` directory, and `ear` directory in that order. Start with the `jar` directory, proceed to the `war` directory, and end with the `ear` directory.
209
+
This command creates a JAR file in the `jar/target` directory, a WAR file in the `war/target` directory, and an EAR file in the `ear/target` directory, which contains the JAR and WAR files.
210
+
211
+
By aggregating the build in the previous section, you can run `mvn install` once from the `start` directory and it will automatically build all your modules. Use the following command to build the entire application from the `start` directory:
151
212
152
213
[role=command]
153
214
----
154
215
mvn install
155
216
----
156
217
157
-
These commands create a JAR file in the `jar/target` directory, a WAR file in the `war/target` directory, and an EAR file in the `ear/target` directory, which contains the JAR and WAR files.
158
-
218
+
Since the modules are independent, you can re-build them individually by running `mvn install` from the corresponding module directory.
Because you have multiple modules, aggregate the Maven projects to simplify the build process.
241
-
242
-
Create a parent `pom.xml` file under the `start` directory to link all of the child modules together. A template is provided for you.
243
-
244
-
[role="code_command hotspot", subs="quotes"]
245
-
----
246
-
#Replace the start/POM file.#
247
-
`start/pom.xml`
248
-
----
249
-
start/pom.xml
250
-
[source, xml, linenums, role='code_column']
251
-
----
252
-
include::finish/pom.xml[tags=**]
253
-
----
254
-
Set the [hotspot=13-17 file=0]`basic configuration` for the project. Set `pom` as the [hotspot=17 file=0]`<packaging/>` element of the parent `pom.xml` file. Specify `io.openliberty.guides` as the [hotspot=14 file=0]`<groupId/>` ID, which the child `pom.xml` files will inherit.
255
-
256
-
In the parent `pom.xml` file, list all of the [hotspot=19-23 file=0]`<modules/>` that you want to aggregate for the application.
257
-
258
-
Lastly,
259
-
260
-
[role="code_command hotspot", subs="quotes"]
261
-
----
262
-
#Update the `pom.xml` in the child module `jar`, `war` and `ear` projects.#
263
-
`jar/pom.xml`
264
-
`war/pom.xml`
265
-
`ear/pom.xml`
266
-
----
267
-
268
-
[role="edit_command_text"]
269
-
Add a [hotspot=1-5]`<parent/>` section just above `basic configuration` to each of the `pom.xml` files in the child modules,
Use the following command to build the entire application from the `start` directory:
286
-
287
-
[role=command]
288
-
----
289
-
mvn install
290
-
----
291
-
292
-
You no longer need to execute multiple `mvn install` commands from different directories. With a single command, you can build and test the whole application and all of the modules.
0 commit comments