Skip to content

Commit 256ced9

Browse files
authored
Retrofit build updates (#7)
* Enforce V5.5 BOM but with V6.1 annotation processor * Default to cics.jvmserver property * Remove Gradle Java toolchain to allow defaults * Remove need for gradle.properties * Remove config for CICS Bundle deploy endpoint * Update to Maven verify * Add JDK 21 to build and promote JDK17
1 parent 21cb1ff commit 256ced9

File tree

8 files changed

+24
-57
lines changed

8 files changed

+24
-57
lines changed

.github/workflows/java.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ jobs:
1313
name: Build Maven
1414

1515
runs-on: ubuntu-latest
16-
continue-on-error: ${{ matrix.experimental }}
1716
strategy:
1817
matrix:
19-
jdk: [8, 11]
20-
experimental: [false]
21-
include:
22-
- jdk: 17
23-
experimental: true
18+
jdk: [8, 11, 17, 21]
2419
steps:
2520
- uses: actions/checkout@v3
2621
- name: Set up JDK ${{ matrix.jdk }}
@@ -44,14 +39,9 @@ jobs:
4439
name: Build Gradle
4540

4641
runs-on: ubuntu-latest
47-
continue-on-error: ${{ matrix.experimental }}
4842
strategy:
4943
matrix:
50-
jdk: [8, 11]
51-
experimental: [false]
52-
include:
53-
- jdk: 17
54-
experimental: true
44+
jdk: [8, 11, 17, 21]
5545
steps:
5646
- uses: actions/checkout@v3
5747
- name: Set up JDK ${{ matrix.jdk }}

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Sample CICS Java application showing use of the `com.ibm.cics.server.invocation.
77
This is a set of sample Eclipse projects for Link to Liberty, demonstrating how you can annotate a POJO packaged in a WAR in a Liberty JVM server, to allow it be called from a CICS program.
88

99
- [cics-java-liberty-link-app](./cics-java-liberty-link-app) - Web project
10-
- [cics-java-liberty-link-bundle](./cics-java-liberty-link-bundle) - CICS bundle project (Maven/Gradle)
10+
- [cics-java-liberty-link-bundle](./cics-java-liberty-link-bundle) - CICS bundle project with Web app and WLPH transaction as bundle parts.
1111
- [etc/config/liberty/server.xml](./etc/config/liberty/server.xml) - Template `server.xml` file.
1212
- [etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle](./etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle) - CICS bundle project (CICS Explorer)
1313

@@ -56,7 +56,7 @@ You can build the sample using an IDE of your choice, or you can build it from t
5656

5757
For an IDE, taking Eclipse as an example, the plug-ins for Gradle *buildship* and Maven *m2e* will integrate with the "Run As..." capability, allowing you to specify a specific version of your chosen build tool.
5858

59-
The required build-tasks are typically `clean build` for Gradle and `clean package` for Maven. Once run, Gradle will generate a WAR file in the `build/libs` directory, while Maven will generate it in the `target` directory.
59+
The required build-tasks are typically `clean build` for Gradle and `clean verify` for Maven. Once run, Gradle will generate a WAR file in the `build/libs` directory, while Maven will generate it in the `target` directory.
6060

6161
> [!NOTE]
6262
> If you import the project to your IDE, you might experience local project compile errors. To resolve these errors you should run a tooling refresh on that project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...".
@@ -80,10 +80,10 @@ gradle clean build
8080

8181
This creates a WAR file inside the `cics-java-liberty-link-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/build/distribution` directory.
8282

83-
The JVM server the CICS bundle is targeted at is controlled through the `jvmserver` property, defined in the [`gradle.properties`](gradle.properties) file, or in the command line:
83+
The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, defined in the [`cics-java-liberty-link-bundle/build.gradle`](cics-java-liberty-link-bundle/build.gradle) file, or on the command line:
8484

8585
```shell
86-
gradle clean build -Pjvmserver=MYJVMS
86+
gradle clean build -Pcics.jvmserver=MYJVM
8787
```
8888

8989
### Maven (command line)
@@ -92,12 +92,17 @@ gradle clean build -Pjvmserver=MYJVMS
9292
Run the following in a local command prompt:
9393

9494
```shell
95-
mvn clean package
95+
mvn clean verify
9696
```
9797

9898
This creates a WAR file inside the `cics-java-liberty-link-app/target` directory and a CICS bundle zIP file inside the `cics-java-liberty-link-bundle/target` directory.
9999

100-
The JVM server the CICS bundle is targeted at is controlled throught the `jvmserver` property, defined in [`cics-java-liberty-link-bundle/pom.xml`](cics-java-liberty-link-bundle/pom.xml) file under the `defaultjvmserver` configuration property.
100+
If building a CICS bundle ZIP the CICS JVM server name for the WAR bundle part should be modified in the
101+
`cics.jvmserver` property, defined in [`cics-java-liberty-link-bundle/pom.xml`](cics-java-liberty-link-bundle/pom.xml) file under the `defaultjvmserver` configuration property, or alternatively can be set on the command line as follows.
102+
103+
```shell
104+
mvn clean verify -Dcics.jvmserver=MYJVM
105+
```
101106

102107
## Deploying to a Liberty JVM server
103108

cics-java-liberty-link-app/build.gradle

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ group = 'com.ibm.cicsdev'
99
archivesBaseName='cics-java-liberty-link'
1010
version = '1.0.0'
1111

12-
1312
// If in Eclipse, add Javadoc to the local project classpath
1413
eclipse
1514
{
@@ -19,31 +18,19 @@ eclipse
1918
}
2019
}
2120

22-
2321
repositories
2422
{
2523
mavenCentral()
2624
}
2725

28-
java
29-
{
30-
toolchain
31-
{
32-
languageVersion = JavaLanguageVersion.of(java_version)
33-
vendor = JvmVendorSpec.IBM
34-
implementation = JvmImplementation.J9
35-
}
36-
}
37-
38-
3926
dependencies
4027
{
41-
// CICS TS V5.5 Maven BOM (as of 19th May 2020)
42-
compileOnly enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:5.5-20200519131930-PH25409")
43-
//annotationProcessor enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:5.5-20200519131930-PH25409")
28+
compileOnly enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:5.5-20200519131930-PH25409") // CICS TS V5.5 Maven BOM
4429

4530
// Don't include JCICS in the final build (no need for version because we have BOM)
4631
compileOnly("com.ibm.cics:com.ibm.cics.server")
4732
compileOnly("com.ibm.cics:com.ibm.cics.server.invocation.annotations")
33+
34+
// Use the V6 annotation processor as this supports Java 11
4835
annotationProcessor("com.ibm.cics:com.ibm.cics.server.invocation:6.1")
4936
}

cics-java-liberty-link-app/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
<artifactId>maven-compiler-plugin</artifactId>
3535
<version>3.12.1</version>
3636
<configuration>
37-
<!-- Enable the CICS Annotation Processor -->
37+
<!-- Enable the CICS Annotation Processor at V6.1 to support Java 11 builds-->
3838
<annotationProcessorPaths>
3939
<annotationProcessorPath>
4040
<groupId>com.ibm.cics</groupId>
4141
<artifactId>com.ibm.cics.server.invocation</artifactId>
42-
<version>6.1</version>
42+
<version>6.1</version>
4343
</annotationProcessorPath>
4444
</annotationProcessorPaths>
4545
</configuration>

cics-java-liberty-link-bundle/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
plugins {
6-
id 'com.ibm.cics.bundle' version "1.0.3"
6+
id 'com.ibm.cics.bundle' version "1.0.7"
77
}
88

99
dependencies {
@@ -12,7 +12,7 @@ dependencies {
1212

1313
cicsBundle {
1414
build {
15-
defaultJVMServer = jvmserver
15+
defaultJVMServer = project.findProperty("cics.jvmserver") ?: "DFHWLP"
1616
}
1717
}
1818

cics-java-liberty-link-bundle/pom.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,11 @@
2828
<plugin>
2929
<groupId>com.ibm.cics</groupId>
3030
<artifactId>cics-bundle-maven-plugin</artifactId>
31+
<version>1.0.7</version>
3132
<extensions>true</extensions>
32-
<executions>
33-
<execution>
34-
<goals>
35-
<goal>deploy</goal>
36-
</goals>
37-
</execution>
38-
</executions>
33+
3934
<configuration>
40-
<defaultjvmserver>${jvmserver}</defaultjvmserver>
41-
<url>${cmci_url}</url>
42-
<username>${cmci_username}</username>
43-
<password>${cmci_password}</password>
44-
<bunddef>CJLLBUND</bunddef>
45-
<csdgroup>CICSDEV</csdgroup>
46-
<cicsplex>${cmci_cicsplex}</cicsplex>
47-
<region>${cmci_region}</region>
35+
<defaultjvmserver>${cics.jvmserver}</defaultjvmserver>
4836
</configuration>
4937
</plugin>
5038
</plugins>

gradle.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
<properties>
1818
<java.version>1.8</java.version>
19-
<jvmserver>DFHWLP</jvmserver>
20-
19+
<cics.jvmserver>DFHWLP</cics.jvmserver>
2120
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2221
<maven.compiler.target>${java.version}</maven.compiler.target>
2322
<maven.compiler.source>${java.version}</maven.compiler.source>

0 commit comments

Comments
 (0)