Skip to content

Commit

Permalink
Merge pull request #5 from cicsdev/documentation-improvements
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
SoftlySplinter authored Feb 21, 2024
2 parents c0ea6da + e8a3fb8 commit 9282939
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
51 changes: 21 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -52,61 +52,52 @@ 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.

### 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 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

Expand Down Expand Up @@ -155,4 +146,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).
4 changes: 2 additions & 2 deletions cics-java-liberty-link-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</execution>
</executions>
<configuration>
<defaultjvmserver>DFHWLP</defaultjvmserver>
<defaultjvmserver>${jvmserver}</defaultjvmserver>
<url>${cmci_url}</url>
<username>${cmci_username}</username>
<password>${cmci_password}</password>
Expand All @@ -49,4 +49,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
<description>Sample CICS Java program showing use of the
com.ibm.cics.server.invocation.CICSProgram annotation for Link to Liberty.</description>

<properties>
<java.version>1.8</java.version>
<jvmserver>DFHWLP</jvmserver>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
Expand All @@ -30,4 +39,4 @@
<module>cics-java-liberty-link-app</module>
<module>cics-java-liberty-link-bundle</module>
</modules>
</project>
</project>

0 comments on commit 9282939

Please sign in to comment.