Skip to content

Commit b231c34

Browse files
authored
restructuring of code
2 parents f78ba16 + 444db17 commit b231c34

11 files changed

Lines changed: 270 additions & 132 deletions

File tree

.github/workflows/java.yaml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,31 @@ on:
88
schedule:
99
- cron: '0 0 * * *'
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build-maven:
1316
name: Build Maven
1417

1518
runs-on: ubuntu-latest
1619
strategy:
1720
matrix:
18-
jdk: [17]
21+
jdk: [17, 21]
1922
steps:
20-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2124
- name: Set up JDK ${{ matrix.jdk }}
22-
uses: actions/setup-java@v3
25+
uses: actions/setup-java@v4
2326
with:
2427
java-version: ${{ matrix.jdk }}
2528
distribution: "semeru"
2629
cache: maven
2730
- name: Build with Maven
28-
run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package
29-
- run: mkdir staging && cp target/*.war staging
31+
run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify
32+
- run: mkdir staging && cp cics-java-liberty-springboot-transactions-app/target/*.war staging
3033
- uses: actions/upload-artifact@v4
3134
with:
32-
name: cics-java-liberty-sprintboot-transactions (Maven, Java ${{ matrix.jdk }})
35+
name: cics-java-liberty-springboot-transactions (Maven, Java ${{ matrix.jdk }})
3336
path: staging
3437

3538
build-mvnw:
@@ -38,33 +41,54 @@ jobs:
3841
runs-on: ubuntu-latest
3942
strategy:
4043
matrix:
41-
jdk: [17]
44+
jdk: [17, 21]
4245
steps:
43-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
4447
- name: Set up JDK ${{ matrix.jdk }}
45-
uses: actions/setup-java@v3
48+
uses: actions/setup-java@v4
4649
with:
4750
java-version: ${{ matrix.jdk }}
4851
distribution: "semeru"
4952
cache: maven
50-
- name: Build with Maven
51-
run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package
53+
- name: Build with Maven Wrapper
54+
run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify
5255

5356
build-gradle:
5457
name: Build Gradle
5558

5659
runs-on: ubuntu-latest
5760
strategy:
5861
matrix:
59-
jdk: [17]
62+
jdk: [17, 21]
6063
steps:
61-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6265
- name: Set up JDK ${{ matrix.jdk }}
6366
uses: actions/setup-java@v4
6467
with:
6568
java-version: ${{ matrix.jdk }}
6669
distribution: 'semeru'
6770
- name: Build with Gradle
68-
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
71+
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25
6972
with:
7073
arguments: build -Pjava_version=${{ matrix.jdk }}
74+
75+
build-gradlew:
76+
name: Build Gradle wrapper
77+
78+
runs-on: ubuntu-latest
79+
strategy:
80+
matrix:
81+
jdk: [17, 21]
82+
steps:
83+
- uses: actions/checkout@v4
84+
- name: Set up JDK ${{ matrix.jdk }}
85+
uses: actions/setup-java@v4
86+
with:
87+
java-version: ${{ matrix.jdk }}
88+
distribution: 'semeru'
89+
- name: Setup Gradle
90+
uses: gradle/actions/setup-gradle@v4
91+
- name: Build with Gradle
92+
run: ./gradlew build -Pjava_version=${{ matrix.jdk }}
93+
94+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
12
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
23
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.gradle/
2+
/target/
3+
/build/
4+
/bin/

build.gradle renamed to cics-java-liberty-springboot-transactions-app/build.gradle

Lines changed: 22 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
plugins
22
{
3-
id 'org.springframework.boot' version '3.5.13'
3+
id 'org.springframework.boot' version '3.5.13'
44
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
55
id 'java'
66
id 'eclipse'
7-
id 'idea'
87
id 'war'
9-
id 'maven-publish'
8+
id 'idea'
109
}
1110

1211
group = 'com.ibm.cicsdev.springboot'
13-
archivesBaseName='cics-java-liberty-springboot-transactions'
1412
version = '0.1.0'
1513

14+
// ============================================================================
15+
// Java Configuration
16+
// ============================================================================
17+
java {
18+
sourceCompatibility = JavaVersion.toVersion(java_version)
19+
targetCompatibility = JavaVersion.toVersion(java_version)
20+
}
21+
22+
// ============================================================================
23+
// WAR Configuration
24+
// ============================================================================
25+
war {
26+
archiveFileName = "cics-java-liberty-springboot-transactions-app-${version}.war"
27+
}
28+
29+
// Two versions of the WAR would be built, one for embedding into servers like Liberty (plain)
30+
// and a bootWAR which can run standalone and contains all the Tomcat and Spring Boot stuff
31+
// we don't need bootWAR, so disable it.
32+
bootWar { enabled = false }
33+
1634
// If in Eclipse, add Javadoc to the local project classpath
1735
eclipse
1836
{
@@ -22,19 +40,11 @@ eclipse
2240
}
2341
}
2442

25-
26-
2743
repositories
2844
{
2945
mavenCentral()
3046
}
3147

32-
java {
33-
toolchain {
34-
languageVersion = JavaLanguageVersion.of(java_version)
35-
}
36-
}
37-
3848

3949
dependencies
4050
{
@@ -55,33 +65,3 @@ dependencies
5565
// Spring's Transactional API
5666
implementation ("org.springframework:spring-tx")
5767
}
58-
59-
//Don't generate a FAT bootWar, we don't need to run standalone
60-
bootWar { enabled = false }
61-
62-
publishing {
63-
publications {
64-
// Publication for JCICS
65-
maven(MavenPublication) {
66-
groupId "${group}"
67-
version "${version}"
68-
artifactId "${archivesBaseName}"
69-
artifact bootWar
70-
}
71-
}
72-
73-
// Configure the Maven repository to publish to somewhere which is configurable
74-
// with environment variables from outside gradle.
75-
//
76-
// For example:
77-
// gradle build publish \
78-
// -Ppublish_repo_releases_url="file://my-folder" \
79-
// -Ppublish_repo_releases_name="my-maven-repo"
80-
//
81-
repositories {
82-
maven {
83-
url = "${publish_repo_releases_url}/${publish_repo_releases_name}"
84-
}
85-
}
86-
87-
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source.. = src/main/java/
2+
bin.includes = META-INF/,.
3+
output.. = bin/
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<!-- Inherit from parent POM -->
7+
<parent>
8+
<groupId>com.ibm.cicsdev</groupId>
9+
<artifactId>cics-java-liberty-springboot-transactions</artifactId>
10+
<version>1.0.0</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<!-- Application module properties -->
15+
<artifactId>cics-java-liberty-springboot-transactions-app</artifactId>
16+
<name>com.ibm.cicsdev.springboot.transactions.app</name>
17+
<description>Demo project for Spring and Liberty transactions</description>
18+
19+
<properties>
20+
<java.version>17</java.version>
21+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22+
<maven.compiler.target>${java.version}</maven.compiler.target>
23+
<maven.compiler.source>${java.version}</maven.compiler.source>
24+
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
25+
</properties>
26+
27+
<!-- CICS TS V6.1 BOM (as of Sept 2024) -->
28+
<dependencyManagement>
29+
<dependencies>
30+
<dependency>
31+
<groupId>com.ibm.cics</groupId>
32+
<artifactId>com.ibm.cics.ts.bom</artifactId>
33+
<version>6.1-20250812133513-PH63856</version>
34+
<type>pom</type>
35+
<scope>import</scope>
36+
</dependency>
37+
</dependencies>
38+
</dependencyManagement>
39+
40+
<dependencies>
41+
<!-- Compile against, but don't include JCICS in the final build (version and scope are from BOM) -->
42+
<dependency>
43+
<groupId>com.ibm.cics</groupId>
44+
<artifactId>com.ibm.cics.server</artifactId>
45+
</dependency>
46+
47+
<!-- Spring Boot web support -->
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-web</artifactId>
51+
</dependency>
52+
53+
<!-- Compile against, but don't include TomCat in the runtime build -->
54+
<dependency>
55+
<groupId>org.springframework.boot</groupId>
56+
<artifactId>spring-boot-starter-tomcat</artifactId>
57+
<scope>provided</scope>
58+
</dependency>
59+
60+
<!-- Spring-transactions -->
61+
<dependency>
62+
<groupId>org.springframework</groupId>
63+
<artifactId>spring-tx</artifactId>
64+
</dependency>
65+
66+
<!-- Compile against, but don't include javax.transaction API -->
67+
<dependency>
68+
<groupId>jakarta.transaction</groupId>
69+
<artifactId>jakarta.transaction-api</artifactId>
70+
<scope>provided</scope>
71+
</dependency>
72+
73+
</dependencies>
74+
75+
<!-- Package as an executable war (default jar) -->
76+
<packaging>war</packaging>
77+
<build>
78+
<plugins>
79+
<plugin>
80+
<groupId>org.springframework.boot</groupId>
81+
<artifactId>spring-boot-maven-plugin</artifactId>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
86+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// ============================================================================
2+
// Plugins
3+
// ============================================================================
4+
plugins {
5+
id 'com.ibm.cics.bundle' version '1.0.8'
6+
}
7+
8+
// ============================================================================
9+
// Project Information
10+
// ============================================================================
11+
description = 'CICS Transactions Springboot Application - CICS Bundle'
12+
version = '1.0.0'
13+
14+
// ============================================================================
15+
// Dependencies
16+
// ============================================================================
17+
dependencies {
18+
// Application WAR from sibling project
19+
cicsBundlePart project(path: ':cics-java-liberty-springboot-transactions-app', configuration: 'archives')
20+
}
21+
22+
// ============================================================================
23+
// CICS Bundle Configuration
24+
// ============================================================================
25+
cicsBundle {
26+
build {
27+
defaultJVMServer = project.findProperty('cics.jvmserver') ?: 'DFHWLP'
28+
}
29+
}
30+
31+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<!-- ================================================================ -->
8+
<!-- Parent Project -->
9+
<!-- ================================================================ -->
10+
<parent>
11+
<groupId>com.ibm.cicsdev</groupId>
12+
<artifactId>cics-java-liberty-springboot-transactions</artifactId>
13+
<version>1.0.0</version>
14+
<relativePath>../pom.xml</relativePath>
15+
</parent>
16+
17+
<!-- ================================================================ -->
18+
<!-- Project Coordinates -->
19+
<!-- ================================================================ -->
20+
<artifactId>cics-java-liberty-springboot-transactions-cicsbundle</artifactId>
21+
<packaging>cics-bundle</packaging>
22+
<name>CICS Transactions Springboot - CICS Bundle</name>
23+
24+
<!-- ================================================================ -->
25+
<!-- Dependencies -->
26+
<!-- ================================================================ -->
27+
<dependencies>
28+
<!-- Application WAR -->
29+
<dependency>
30+
<groupId>${project.groupId}</groupId>
31+
<artifactId>cics-java-liberty-springboot-transactions-app</artifactId>
32+
<version>${project.version}</version>
33+
<type>war</type>
34+
</dependency>
35+
</dependencies>
36+
37+
<!-- ================================================================ -->
38+
<!-- Build Configuration -->
39+
<!-- ================================================================ -->
40+
<build>
41+
<plugins>
42+
<!-- CICS Bundle Maven Plugin -->
43+
<plugin>
44+
<groupId>com.ibm.cics</groupId>
45+
<artifactId>cics-bundle-maven-plugin</artifactId>
46+
<version>1.0.8</version>
47+
<extensions>true</extensions>
48+
<configuration>
49+
<defaultjvmserver>${cics.jvmserver}</defaultjvmserver>
50+
</configuration>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
55+
</project>
56+
57+

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# For example: gradle build publish.
1515
publish_repo_releases_url = 'default-value-for-publish_repo_releases_url'
1616
publish_repo_releases_name = 'default-value-for-publish_repo_releases_name'
17-
java_version = 17
17+
java_version = 17

0 commit comments

Comments
 (0)