Skip to content

Commit c259064

Browse files
Merge pull request #26 from cicsdev/standardize-readme-and-build-commands
Standardize README and build commands per validation framework
2 parents 2600063 + f4194d1 commit c259064

2 files changed

Lines changed: 67 additions & 29 deletions

File tree

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
distribution: "semeru"
4444
cache: maven
4545
- name: Build with Maven
46-
run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package
46+
run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify
4747

4848
build-mvnw:
4949
name: Build Maven Wrapper
@@ -60,7 +60,7 @@ jobs:
6060
java-version: ${{ matrix.jdk }}
6161
distribution: "semeru"
6262
- name: Build with Maven
63-
run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package
63+
run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify
6464

6565
build-gradle:
6666
name: Build Gradle
@@ -81,7 +81,7 @@ jobs:
8181
with:
8282
gradle-version: 8.14.4
8383
- name: Build with Gradle
84-
run: gradle build -Pjava_version=${{ matrix.jdk }}
84+
run: gradle clean build -Pjava_version=${{ matrix.jdk }}
8585

8686
build-gradlew:
8787
name: Build Gradle wrapper
@@ -98,6 +98,6 @@ jobs:
9898
java-version: ${{ matrix.jdk }}
9999
distribution: 'semeru'
100100
- name: Build with Gradle Wrapper
101-
run: ./gradlew build -Pjava_version=${{ matrix.jdk }}
101+
run: ./gradlew clean build -Pjava_version=${{ matrix.jdk }}
102102

103103

README.md

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
# cics-java-liberty-springboot-transactions
22
[![Build](https://github.com/cicsdev/cics-java-liberty-springboot-transactions/actions/workflows/build.yaml/badge.svg)](https://github.com/cicsdev/cics-java-liberty-springboot-transactions/actions/workflows/build.yaml)
3+
[![License](https://img.shields.io/badge/License-EPL%202.0-red.svg)](https://www.eclipse.org/legal/epl-2.0/)
34

4-
This sample project demonstrates how a Spring Boot application deployed to a Liberty JVM server, can use different techniques to integrate with CICS transactions. The application uses a web browser front end and makes use of the Java™ Transaction API (JTA). The three techniques demonstrated are: Java EE User Transaction, Spring's `@Transactional` annotation, and the Spring Transaction Template.
5+
## Overview
56

6-
The Java™ Transaction API (JTA) is described in the [IBM JavaTransaction API (JTA)](https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.4.0/applications/developing/java/dfhpj2_jta.html)
7+
This sample project demonstrates how a Spring Boot application deployed to a Liberty JVM server can use different techniques to integrate with CICS transactions. The application uses a web browser front end and makes use of the Java™ Transaction API (JTA). The three techniques demonstrated are: Java EE User Transaction, Spring's `@Transactional` annotation, and the Spring Transaction Template.
78

8-
For more information on `@Transactional` and Spring Transaction Templates see [Spring Transaction Management](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html)
9+
## Key Features
910

10-
The artifact built from this project is a WAR file that can be deployed into CICS Liberty in a variety of ways from a direct <application> entry in server.xml, to a CICS bundle project. For more information, see **Deploying**.
11+
- **JTA Integration**: Demonstrates Java Transaction API usage in CICS
12+
- **Multiple Transaction Techniques**: Shows three different approaches to transaction management
13+
- **Spring Boot Integration**: Uses Spring's `@Transactional` annotation and Transaction Template
14+
- **Java EE User Transaction**: Demonstrates programmatic transaction control
15+
- **Recoverable TSQ Operations**: Shows transaction commit and rollback with CICS temporary storage queues
16+
17+
## Table of Contents
18+
19+
- [Overview](#overview)
20+
- [Key Features](#key-features)
21+
- [Prerequisites](#prerequisites)
22+
- [Reference](#reference)
23+
- [Downloading](#downloading)
24+
- [Building the Sample](#building-the-sample)
25+
- [Deploying to a CICS Liberty JVM server](#deploying-to-a-cics-liberty-jvm-server)
26+
- [Running the Sample](#running-the-sample)
27+
- [License](#license)
28+
- [Additional Resources](#additional-resources)
29+
- [Contributing](#contributing)
1130

1231
## Prerequisites
1332

@@ -55,15 +74,15 @@ Maven (POM.xml):
5574
```
5675

5776

58-
## Building
77+
## Building the Sample
5978

6079
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.
6180

6281
On the command line, you simply swap the Gradle or Maven command for the wrapper equivalent, `gradlew` or `mvnw` respectively.
6382

6483
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.
6584

66-
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.
85+
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.
6786

6887
**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.
6988

@@ -96,47 +115,56 @@ Run the following in a local command prompt:
96115
On Linux or Mac:
97116

98117
```shell
99-
./mvnw clean package
118+
./mvnw clean verify
100119
```
101120

102121
On Windows:
103122

104123
```shell
105-
mvnw.cmd clean package
124+
mvnw.cmd clean verify
106125
```
107126

108127
This creates a WAR file inside the `target` directory.
109128

110-
## Deploying
129+
## Deploying to a CICS Liberty JVM server
130+
131+
### Prerequisites
132+
133+
Ensure you have the following features defined in your Liberty `server.xml`:
134+
- `<feature>pages-3.1</feature>` (which itself contains `servlet`)
135+
- `<feature>cicsts:security-1.0</feature>` if CICS security is enabled
111136

112-
Ensure you have the `pages-3.1` feature (which itself contains `servlet`) configured in `server.xml`:
137+
---
113138

114-
Either:
115-
1. Create a CICS bundle project and copy the WAR file into it.
139+
### Method 1: CICS Explorer SDK Deployment
116140

117-
2. Add a *Dynamic Web Project include* to the project to point at the local WAR file.
141+
1. Copy the built WAR from your *build/libs* or *target* directory into an Eclipse CICS Bundle Project
142+
2. Create a new WAR bundlepart that references the WAR file
143+
3. Deploy the CICS Bundle Project from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard
118144

119-
3. Deploy the CICS bundle project to CICS.
145+
---
120146

121-
4. Enable the JVM server and CICS bundle.
147+
### Method 2: Direct Liberty Application Deployment
122148

123-
Or:
124-
1. Manually upload the WAR file to zFS and add an `<application>` configuration element to server.xml:
149+
1. Manually upload the WAR file to zFS
150+
2. Add an `<application>` element to the Liberty server.xml to define the web application with access to all authenticated users:
125151

126152
```xml
127-
<application id="cics-java-liberty-springboot-transactions-0.1.0"
128-
location="${server.config.dir}/springapps/cics-java-liberty-springboot-transactions-0.1.0.war"
129-
name="cics-java-liberty-springboot-transactions-0.1.0" type="war">
130-
<application-bnd>
153+
<application id="cics-java-liberty-springboot-transactions-0.1.0"
154+
location="${server.config.dir}/springapps/cics-java-liberty-springboot-transactions-0.1.0.war"
155+
name="cics-java-liberty-springboot-transactions-0.1.0" type="war">
156+
<application-bnd>
131157
<security-role name="cicsAllAuthenticated">
132158
<special-subject type="ALL_AUTHENTICATED_USERS"/>
133159
</security-role>
134-
</application-bnd>
135-
</application>
160+
</application-bnd>
161+
</application>
136162
```
137163

164+
---
165+
138166

139-
## Trying out the sample
167+
## Running the Sample
140168

141169
1. With the application installed, the root URL for the sample application can be found in messages.log e.g. `http://myzos.mycompany.com:32000/cics-java-liberty-springboot-transactions-0.1.0/`.
142170

@@ -153,6 +181,16 @@ Or:
153181

154182

155183
## License
156-
This project is licensed under [Eclipse Public License - v 2.0](LICENSE).
184+
This project is licensed under [Eclipse Public License - v 2.0](LICENSE).
185+
186+
## Additional Resources
187+
188+
- [CICS TS for z/OS Documentation](https://www.ibm.com/docs/en/cics-ts)
189+
- [Spring Boot Java applications for CICS, Part 3: Transactions](https://developer.ibm.com/tutorials/spring-boot-java-applications-for-cics-part-3-transactions/)
190+
- [IBM Java Transaction API (JTA)](https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.4.0/applications/developing/java/dfhpj2_jta.html)
191+
- [Spring Transaction Management](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html)
192+
193+
## Contributing
157194

195+
Contributions are welcome! Please read our [contributing guidelines](https://github.com/cicsdev/.github/blob/main/CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
158196

0 commit comments

Comments
 (0)