diff --git a/.github/workflows/java.yaml b/.github/workflows/java.yaml index 1a3ce55..71cf2df 100644 --- a/.github/workflows/java.yaml +++ b/.github/workflows/java.yaml @@ -8,6 +8,9 @@ on: schedule: - cron: '0 0 * * *' +permissions: + contents: read + jobs: build-maven: name: Build Maven @@ -15,21 +18,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - jdk: [17] + jdk: [17, 21] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} distribution: "semeru" cache: maven - name: Build with Maven - run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package - - run: mkdir staging && cp target/*.war staging + run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify + - run: mkdir staging && cp cics-java-liberty-springboot-transactions-app/target/*.war staging - uses: actions/upload-artifact@v4 with: - name: cics-java-liberty-sprintboot-transactions (Maven, Java ${{ matrix.jdk }}) + name: cics-java-liberty-springboot-transactions (Maven, Java ${{ matrix.jdk }}) path: staging build-mvnw: @@ -38,17 +41,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - jdk: [17] + jdk: [17, 21] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} distribution: "semeru" cache: maven - - name: Build with Maven - run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package + - name: Build with Maven Wrapper + run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify build-gradle: name: Build Gradle @@ -56,15 +59,36 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - jdk: [17] + jdk: [17, 21] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.jdk }} uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} distribution: 'semeru' - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 with: arguments: build -Pjava_version=${{ matrix.jdk }} + + build-gradlew: + name: Build Gradle wrapper + + runs-on: ubuntu-latest + strategy: + matrix: + jdk: [17, 21] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ matrix.jdk }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.jdk }} + distribution: 'semeru' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Build with Gradle + run: ./gradlew build -Pjava_version=${{ matrix.jdk }} + + diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 90ffde7..70db5db 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,3 @@ + distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/cics-java-liberty-springboot-transactions-app/.gitignore b/cics-java-liberty-springboot-transactions-app/.gitignore new file mode 100644 index 0000000..4c91246 --- /dev/null +++ b/cics-java-liberty-springboot-transactions-app/.gitignore @@ -0,0 +1,4 @@ +/.gradle/ +/target/ +/build/ +/bin/ diff --git a/build.gradle b/cics-java-liberty-springboot-transactions-app/build.gradle similarity index 53% rename from build.gradle rename to cics-java-liberty-springboot-transactions-app/build.gradle index d98eff1..3f4ef39 100644 --- a/build.gradle +++ b/cics-java-liberty-springboot-transactions-app/build.gradle @@ -1,18 +1,36 @@ plugins { - id 'org.springframework.boot' version '3.5.13' + id 'org.springframework.boot' version '3.5.13' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' id 'eclipse' - id 'idea' id 'war' - id 'maven-publish' + id 'idea' } group = 'com.ibm.cicsdev.springboot' -archivesBaseName='cics-java-liberty-springboot-transactions' version = '0.1.0' +// ============================================================================ +// Java Configuration +// ============================================================================ +java { + sourceCompatibility = JavaVersion.toVersion(java_version) + targetCompatibility = JavaVersion.toVersion(java_version) +} + +// ============================================================================ +// WAR Configuration +// ============================================================================ +war { + archiveFileName = "cics-java-liberty-springboot-transactions-app-${version}.war" +} + +// Two versions of the WAR would be built, one for embedding into servers like Liberty (plain) +// and a bootWAR which can run standalone and contains all the Tomcat and Spring Boot stuff +// we don't need bootWAR, so disable it. +bootWar { enabled = false } + // If in Eclipse, add Javadoc to the local project classpath eclipse { @@ -22,19 +40,11 @@ eclipse } } - - repositories { mavenCentral() } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(java_version) - } -} - dependencies { @@ -55,33 +65,3 @@ dependencies // Spring's Transactional API implementation ("org.springframework:spring-tx") } - -//Don't generate a FAT bootWar, we don't need to run standalone -bootWar { enabled = false } - -publishing { - publications { - // Publication for JCICS - maven(MavenPublication) { - groupId "${group}" - version "${version}" - artifactId "${archivesBaseName}" - artifact bootWar - } - } - - // Configure the Maven repository to publish to somewhere which is configurable - // with environment variables from outside gradle. - // - // For example: - // gradle build publish \ - // -Ppublish_repo_releases_url="file://my-folder" \ - // -Ppublish_repo_releases_name="my-maven-repo" - // - repositories { - maven { - url = "${publish_repo_releases_url}/${publish_repo_releases_name}" - } - } - -} diff --git a/cics-java-liberty-springboot-transactions-app/build.properties b/cics-java-liberty-springboot-transactions-app/build.properties new file mode 100644 index 0000000..084ecae --- /dev/null +++ b/cics-java-liberty-springboot-transactions-app/build.properties @@ -0,0 +1,3 @@ +source.. = src/main/java/ +bin.includes = META-INF/,. +output.. = bin/ \ No newline at end of file diff --git a/cics-java-liberty-springboot-transactions-app/pom.xml b/cics-java-liberty-springboot-transactions-app/pom.xml new file mode 100644 index 0000000..c07bbb8 --- /dev/null +++ b/cics-java-liberty-springboot-transactions-app/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + + + com.ibm.cicsdev + cics-java-liberty-springboot-transactions + 1.0.0 + ../pom.xml + + + + cics-java-liberty-springboot-transactions-app + com.ibm.cicsdev.springboot.transactions.app + Demo project for Spring and Liberty transactions + + + 17 + UTF-8 + ${java.version} + ${java.version} + true + + + + + + + com.ibm.cics + com.ibm.cics.ts.bom + 6.1-20250812133513-PH63856 + pom + import + + + + + + + + com.ibm.cics + com.ibm.cics.server + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + + org.springframework + spring-tx + + + + + jakarta.transaction + jakarta.transaction-api + provided + + + + + + war + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/cics-java-liberty-springboot-transactions-cicsbundle/build.gradle b/cics-java-liberty-springboot-transactions-cicsbundle/build.gradle new file mode 100644 index 0000000..722f3a7 --- /dev/null +++ b/cics-java-liberty-springboot-transactions-cicsbundle/build.gradle @@ -0,0 +1,31 @@ +// ============================================================================ +// Plugins +// ============================================================================ +plugins { + id 'com.ibm.cics.bundle' version '1.0.8' +} + +// ============================================================================ +// Project Information +// ============================================================================ +description = 'CICS Transactions Springboot Application - CICS Bundle' +version = '1.0.0' + +// ============================================================================ +// Dependencies +// ============================================================================ +dependencies { + // Application WAR from sibling project + cicsBundlePart project(path: ':cics-java-liberty-springboot-transactions-app', configuration: 'archives') +} + +// ============================================================================ +// CICS Bundle Configuration +// ============================================================================ +cicsBundle { + build { + defaultJVMServer = project.findProperty('cics.jvmserver') ?: 'DFHWLP' + } +} + + diff --git a/cics-java-liberty-springboot-transactions-cicsbundle/pom.xml b/cics-java-liberty-springboot-transactions-cicsbundle/pom.xml new file mode 100644 index 0000000..b3dcce5 --- /dev/null +++ b/cics-java-liberty-springboot-transactions-cicsbundle/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + + + + + com.ibm.cicsdev + cics-java-liberty-springboot-transactions + 1.0.0 + ../pom.xml + + + + + + cics-java-liberty-springboot-transactions-cicsbundle + cics-bundle + CICS Transactions Springboot - CICS Bundle + + + + + + + + ${project.groupId} + cics-java-liberty-springboot-transactions-app + ${project.version} + war + + + + + + + + + + + com.ibm.cics + cics-bundle-maven-plugin + 1.0.8 + true + + ${cics.jvmserver} + + + + + + + + diff --git a/gradle.properties b/gradle.properties index 9fa633b..ce648b0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,4 @@ # For example: gradle build publish. publish_repo_releases_url = 'default-value-for-publish_repo_releases_url' publish_repo_releases_name = 'default-value-for-publish_repo_releases_name' -java_version = 17 \ No newline at end of file +java_version = 17 diff --git a/pom.xml b/pom.xml index 5632bc8..90aa10d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,25 +11,27 @@ - - + + + com.ibm.cicsdev cics-java-liberty-springboot-transactions - 0.1.0 - com.ibm.cicsdev.springboot.transactions - Demo project for Spring and Liberty transactions + 1.0.0 + Demo project for Spring Boot and Liberty transactions + pom 17 UTF-8 ${java.version} - ${java.version} - true + ${java.version} + DFHWLP - + + com.ibm.cics com.ibm.cics.ts.bom @@ -40,71 +42,12 @@ - - - - com.ibm.cics - com.ibm.cics.server - - - - - org.springframework.boot - spring-boot-starter-web - - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - - org.springframework - spring-tx - - - - - jakarta.transaction - jakarta.transaction-api - provided - - - - - - war - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - - - ${publish_repo_snapshots_name} - ${publish_repo_snapshots_url} - - - ${publish_repo_releases_name} - ${publish_repo_releases_url} - - + + + + + cics-java-liberty-springboot-transactions-app + cics-java-liberty-springboot-transactions-cicsbundle + diff --git a/settings.gradle b/settings.gradle index fbc663b..9689704 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,10 @@ -rootProject.name = 'com.ibm.cicsdev.springboot.transactions' \ No newline at end of file +// ============================================================================ +// Root Project Configuration +// ============================================================================ +rootProject.name = 'cics-java-liberty-springboot-transactions' + +// ============================================================================ +// Subprojects +// ============================================================================ +include(':cics-java-liberty-springboot-transactions-app') +include(':cics-java-liberty-springboot-transactions-cicsbundle') \ No newline at end of file