Skip to content

Commit

Permalink
Use versionless features (#180)
Browse files Browse the repository at this point in the history
* use versionless feature

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* use versionless feature

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* use versionless feature

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* The ear file should not package the jar file twice (#182)

* make ear not include the jar

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* make ear not include the jar

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

---------

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* Update README.adoc

* use versionless feature

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>

* Update README.adoc

* Update server.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

---------

Signed-off-by: Gilbert Kwan <gkwan@ca.ibm.com>
  • Loading branch information
gkwan-ibm authored Feb 6, 2025
1 parent 77a996a commit 732ad92
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 42 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
canSkip: ${{ steps.Checker.outputs.canSkip }}
steps:
- name: Get files
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get tools
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: tools/
repository: openliberty/guides-common
Expand Down Expand Up @@ -45,10 +45,11 @@ jobs:
working-directory: finish

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'semeru'
java-version: 11
- run: unset _JAVA_OPTIONS

Expand Down
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017, 2023 IBM Corporation and others.
// Copyright (c) 2017, 2025 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand Down Expand Up @@ -149,7 +149,7 @@ Set the [hotspot=packaging file=0]`basic configuration` for the project and set

The [hotspot=dependency-jar file=0]`Java library module` and the [hotspot=dependency-war file=0]`web module` were added as dependencies. Specify a type of [hotspot=warType file=0]`war` for the web module. If you don’t specify this type for the web module, Maven looks for a JAR file.

The definition and configuration of the [hotspot=maven-ear-plugin file=0]`maven-ear-plugin` plug-in were added to create an EAR file. Define the [hotspot=jarModule file=0]`jarModule` and [hotspot=webModule file=0]`webModule` modules to be packaged into the EAR file. To customize the context root of the application, set the [hotspot=contextRoot file=0]`contextRoot` element to [hotspot=contextRoot file=0]`/converter` in the [hotspot=webModule file=0]`webModule`. Otherwise, Maven automatically uses the WAR file `artifactId` ID as the context root for the application while generating the `application.xml` file.
The definition and configuration of the [hotspot=maven-ear-plugin file=0]`maven-ear-plugin` plug-in were added to create an EAR file. Define the [hotspot=webModule file=0]`webModule` module to be packaged into the EAR file. To customize the context root of the application, set the [hotspot=contextRoot file=0]`contextRoot` element to [hotspot=contextRoot file=0]`/converter` in the [hotspot=webModule file=0]`webModule`. Otherwise, Maven automatically uses the WAR file `artifactId` ID as the context root for the application while generating the `application.xml` file.

To deploy and run an EAR application on an Open Liberty instance, you need to provide a Liberty's `server.xml` configuration file.

Expand Down Expand Up @@ -334,7 +334,7 @@ mvn install
```
endif::[]

Since the modules are independent, you can re-build them individually by running `mvn install` from the corresponding `start` directory for each module.
Because the modules are independent, you can re-build them individually by running `mvn install` from the corresponding `start` directory for each module.

ifndef::cloud-hosted[]
Or, run `mvn -pl <child project> install` from the start directory.
Expand Down
8 changes: 1 addition & 7 deletions finish/ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<artifactId>guide-maven-multimodules-jar</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<!-- end::dependency-jar[] -->
<!-- tag::dependency-war[] -->
Expand Down Expand Up @@ -71,13 +72,6 @@
<version>3.3.0</version>
<configuration>
<modules>
<!-- tag::jarModule[] -->
<jarModule>
<groupId>io.openliberty.guides</groupId>
<artifactId>guide-maven-multimodules-jar</artifactId>
<uri>/guide-maven-multimodules-jar-1.0-SNAPSHOT.jar</uri>
</jarModule>
<!-- end::jarModule[] -->
<!-- tag::webModule[] -->
<webModule>
<groupId>io.openliberty.guides</groupId>
Expand Down
4 changes: 3 additions & 1 deletion finish/ear/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<server description="Sample Liberty server">

<featureManager>
<feature>pages-3.1</feature>
<platform>jakartaee-10.0</platform>
<feature>pages</feature>
</featureManager>

<variable name="http.port" defaultValue="9080" />
Expand All @@ -17,4 +18,5 @@
name="guide-maven-multimodules-ear" />
<!-- end::EARdefinition[] -->
<!-- end::server[] -->

</server>
8 changes: 1 addition & 7 deletions finish/war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@

<dependencies>
<!-- Provided dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
Expand All @@ -45,7 +39,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions start/ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -47,7 +47,7 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.5.1</version>
<version>3.11.1</version>
</plugin>

<!-- Since the package type is ear,
Expand All @@ -71,7 +71,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
<version>3.5.1</version>
<configuration>
<systemPropertyVariables>
<http.port>
Expand Down
12 changes: 3 additions & 9 deletions start/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@

<modelVersion>4.0.0</modelVersion>

<!-- tag::packaging[] -->
<!-- TO-DO: ADD THE CONFIGURATION HERE -->
<!-- end::packaging[] -->
<!-- TO-DO: ADD THE PACKAGING CONFIGURATION HERE -->

<!-- tag::modules[] -->
<!-- TO-DO: ADD THE CONFIGURATION HERE -->
<!-- end::modules[] -->
<!-- TO-DO: ADD THE MODULES CONFIGURATION HERE -->

<!-- tag::liberty-maven-plugin[] -->
<!-- TO-DO: ADD THE CONFIGURATION HERE -->
<!-- end::liberty-maven-plugin[] -->
<!-- TO-DO: ADD THE BUILD CONFIGURATION HERE -->

</project>
10 changes: 2 additions & 8 deletions start/war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,16 @@
<dependencies>

<!-- Provided dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>5.0</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down

0 comments on commit 732ad92

Please sign in to comment.