From d9856f35ea38aa90fb3af3ee73d8d0cd8a182753 Mon Sep 17 00:00:00 2001 From: Alex Brown <1159704+SoftlySplinter@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:58:54 +0000 Subject: [PATCH 1/4] Improve documentation * Remove references to unused wrappers. * Remove unused SpringBoot references. * Added details on controlling the JVM server in the CICS bundle. --- README.md | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index e6b7712..0d16ad1 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ This is a set of sample Eclipse projects for Link to Liberty, demonstrating how - [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) ## Prerequisites -* CICS TS V5.4 or later +* CICS TS V5.5 or later * Java SE 1.8 or later on the workstation * Eclipse with the IBM CICS SDK for Java EE, Jakarta EE and Liberty, or any IDE that supports usage of the Maven Central artifact [com.ibm.cics:com.ibm.cics.server.](https://search.maven.org/artifact/com.ibm.cics/com.ibm.cics.server) -* Either Gradle or Apache Maven on the workstation (optional if using Wrappers) +* Either Gradle or Apache Maven on the workstation ## Downloading @@ -52,17 +52,14 @@ Maven (POM.xml): ## Building -You can build the sample using an IDE of your choice, or you can build it from the command line. For both approaches, using the supplied Gradle or Maven wrapper is the recommended way to get a consistent version of build tooling. - -On the command line, you simply swap the Gradle or Maven command for the wrapper equivalent, `gradlew` or `mvnw` respectively. +You can build the sample using an IDE of your choice, or you can build it from the command line. For both approaches, using Gradle or Maven is the recommended way to get a consistent version of build tooling. -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 whether you want to build the project with a Wrapper, or a specific version of your chosen build tool. - -The required build-tasks are typically `clean bootWar` 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. +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. -**Note:** When building a WAR file for deployment to Liberty it is good practice to exclude Tomcat from the final runtime artifact. We demonstrate this in the pom.xml with the *provided* scope, and in build.gradle with the *providedRuntime()* dependency. +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. -**Note:** 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...". +> [!NOTE] +> 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...". > [!TIP] > In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update. @@ -72,41 +69,34 @@ The required build-tasks are typically `clean bootWar` for Gradle and `clean pac Import the projects into CICS Explorer using File → Import → General → Existing projects into workspace. > **Note:** If using the egit client, you can just clone the repo and tick the button to import all projects. -### Gradle Wrapper (command line) +### Gradle (command line) Run the following in a local command prompt: -On Linux or Mac: - ```shell -./gradlew clean bootWar +gradle clean build ``` -On Windows: + +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. + +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: ```shell -gradlew.bat clean bootWar +gradle clean build -Pjvmserver=MYJVMS ``` -This creates a WAR file inside the `build/libs` directory. - -### Maven Wrapper (command line) +### Maven (command line) Run the following in a local command prompt: -On Linux or Mac: - ```shell -./mvnw clean package +mvn clean package ``` -On Windows: - -```shell -mvnw.cmd clean package -``` +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. -This creates a WAR file inside the `target` directory. +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.xm) file under the `defaultjvmserver` configuration property. ## Deploying to a Liberty JVM server @@ -155,4 +145,4 @@ CECI LINK PROG(HELLOWLP) CHANNEL(CHAN) Alternatively, the enterprise Java program can be run using the provided `WLPH` transaction. ## Find out more -For more information about invoking Java EE applications in a Liberty JVM server from CICS programs, see [Linking to Java applications in a Liberty JVM server by using the @CICSProgram annotation](https://www.ibm.com/docs/en/cics-ts/6.1?topic=djariljs-linking-java-applications-in-liberty-jvm-server-by-using-cicsprogram-annotation). +For more information about invoking Java EE applications in a Liberty JVM server from CICS programs, see [Linking to Java applications in a Liberty JVM server by using the @CICSProgram annotation](https://www.ibm.com/docs/en/cics-ts/latest?topic=djariljs-linking-java-applications-in-liberty-jvm-server-by-using-cicsprogram-annotation). From 6871318254415dbb8563c1a89a03e30e3890ec5a Mon Sep 17 00:00:00 2001 From: Alex Brown <1159704+SoftlySplinter@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:02:58 +0000 Subject: [PATCH 2/4] Add java.version and jvmserver properties. --- pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fd4893..83e51b3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,15 @@ Sample CICS Java program showing use of the com.ibm.cics.server.invocation.CICSProgram annotation for Link to Liberty. + + 1.8 + DFHWLP + + UTF-8 + ${java.version} + ${java.version} + + @@ -30,4 +39,4 @@ cics-java-liberty-link-app cics-java-liberty-link-bundle - \ No newline at end of file + From 31cb57ca8548fc729527d58cb07539e777c7c706 Mon Sep 17 00:00:00 2001 From: Alex Brown <1159704+SoftlySplinter@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:03:26 +0000 Subject: [PATCH 3/4] Use jvmserver property. --- cics-java-liberty-link-bundle/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cics-java-liberty-link-bundle/pom.xml b/cics-java-liberty-link-bundle/pom.xml index 2021f15..78ba46d 100644 --- a/cics-java-liberty-link-bundle/pom.xml +++ b/cics-java-liberty-link-bundle/pom.xml @@ -37,7 +37,7 @@ - DFHWLP + ${jvmserver} ${cmci_url} ${cmci_username} ${cmci_password} @@ -49,4 +49,4 @@ - \ No newline at end of file + From e8a3fb890d22f591b39fb8db5dbd6076ebb88287 Mon Sep 17 00:00:00 2001 From: Alex Brown <1159704+SoftlySplinter@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:06:01 +0000 Subject: [PATCH 4/4] Add another note section. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d16ad1..20cf6e6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ The required build-tasks are typically `clean build` for Gradle and `clean packa ### Eclipse Import the projects into CICS Explorer using File → Import → General → Existing projects into workspace. -> **Note:** If using the egit client, you can just clone the repo and tick the button to import all projects. +> [!NOTE] +> If using the egit client, you can just clone the repo and tick the button to import all projects. ### Gradle (command line)