Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cics-java-liberty-springboot-link
[![Build](https://github.com/cicsdev/cics-java-liberty-springboot-link/actions/workflows/java.yaml/badge.svg)](https://github.com/cicsdev/cics-java-liberty-springboot-link/actions/workflows/java.yaml)
[![Build](https://github.com/cicsdev/cics-java-liberty-springboot-link/actions/workflows/build.yaml/badge.svg)](https://github.com/cicsdev/cics-java-liberty-springboot-link/actions/workflows/build.yaml)

This sample demonstrates how you can link to a Spring Boot application in a Liberty JVM server from a CICS program. The application is based on a Spring Boot sample application that demonstrates Spring MVC, so has both a web front-end and a CICS entry point using the link to Liberty `@CICSProgram` annotation. The sample shows how both entry points can access the same data.

Expand Down
21 changes: 17 additions & 4 deletions build.gradle → ...-liberty-springboot-link-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,30 @@ plugins
}

group = 'com.ibm.cicsdev.springboot'
archivesBaseName='cics-java-liberty-springboot-link'
version = '0.1.0'
version = '1.0.0'

// ============================================================================
// Java Configuration
// ============================================================================
java {
sourceCompatibility = JavaVersion.toVersion(java_version)
targetCompatibility = JavaVersion.toVersion(java_version)
toolchain {
languageVersion = JavaLanguageVersion.of(java_version)
}
}

// ============================================================================
// WAR Configuration
// ============================================================================
war
{
archiveFileName = "cics-java-liberty-springboot-link-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
{
Expand Down
114 changes: 114 additions & 0 deletions cics-java-liberty-springboot-link-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- Inherit from parent POM -->
<parent>
<groupId>com.ibm.cicsdev</groupId>
<artifactId>cics-java-liberty-springboot-link</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<!-- Application module properties -->
<artifactId>cics-java-liberty-springboot-link-app</artifactId>
<name>com.ibm.cicsdev.springboot.link.app</name>
<description>Demo project for Spring Boot with CICS Link - Application</description>

<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>${java.version}</maven.compiler.release>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>

<!-- CICS TS V6.1 BOM (as of Sept 2024) -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.ts.bom</artifactId>
<version>6.1-20250812133513-PH63856</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Compile against, but don't include JCICS in the final build (version and scope are from BOM) -->
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.server</artifactId>
</dependency>

<!-- CICS Annotations -->
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.server.invocation.annotations</artifactId>
</dependency>

<!-- Spring web support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- Validation annotation support for validating Web input forms -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>

<!-- Thymeleaf view -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

<!-- Don't include TomCat in the runtime build, but put it in lib-provided so it can run standalone as well as embedded -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

<!-- Add tiles-el dependency if using JSF, see README for more details -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-el</artifactId>
<version>3.0.8</version>
</dependency>

</dependencies>

<!-- Package as an executable war (default jar) -->
<packaging>war</packaging>

<!-- Build with Maven and CICS annotation processor -->
<build>
<plugins>
<!-- Spring Boot plugin for Maven -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<!-- Enable the Link to Liberty annotation processor -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.server.invocation</artifactId>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

</project>
33 changes: 33 additions & 0 deletions cics-java-liberty-springboot-link-cicsbundle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ============================================================================
// Plugins
// ============================================================================
plugins
{
id 'com.ibm.cics.bundle' version '1.0.8'
}

// ============================================================================
// Project Information
// ============================================================================
description = 'CICS Spring Boot Link Application - CICS Bundle'
version = '1.0.0'

// ============================================================================
// Dependencies
// ============================================================================
dependencies
{
// Application WAR from sibling project
cicsBundlePart project(path: ':cics-java-liberty-springboot-link-app', configuration: 'archives')
}

// ============================================================================
// CICS Bundle Configuration
// ============================================================================
cicsBundle
{
build
{
defaultJVMServer = project.findProperty('cics.jvmserver') ?: 'DFHWLP'
}
}
57 changes: 57 additions & 0 deletions cics-java-liberty-springboot-link-cicsbundle/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- ================================================================ -->
<!-- Parent Project -->
<!-- ================================================================ -->
<parent>
<groupId>com.ibm.cicsdev</groupId>
<artifactId>cics-java-liberty-springboot-link</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<!-- ================================================================ -->
<!-- Project Coordinates -->
<!-- ================================================================ -->
<artifactId>cics-java-liberty-springboot-link-cicsbundle</artifactId>
<packaging>cics-bundle</packaging>
<name>CICS Spring Boot Link - CICS Bundle</name>

<!-- ================================================================ -->
<!-- Dependencies -->
<!-- ================================================================ -->
<dependencies>
<!-- Application WAR -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cics-java-liberty-springboot-link-app</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>

<!-- ================================================================ -->
<!-- Build Configuration -->
<!-- ================================================================ -->
<build>
<plugins>
<!-- CICS Bundle Maven Plugin -->
<plugin>
<groupId>com.ibm.cics</groupId>
<artifactId>cics-bundle-maven-plugin</artifactId>
<version>1.0.8</version>
<extensions>true</extensions>
<configuration>
<defaultjvmserver>${cics.jvmserver}</defaultjvmserver>
</configuration>
</plugin>
</plugins>
</build>

</project>


14 changes: 10 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#
# Values in this file provide defaults to variables used in the
# Values in this file provide defaults to variables used in the
# gradle files.
#

# Normally we don't publish any built artifacts to a repository.
# But if we do, these are the default values we use to indicate
# where the files should be placed.
#
# These can be over-ridden from the command line
# These can be over-ridden from the command line
# with -Ppublish_repo_releases_url="file://my-folder" for example.
#
#
# These values only have any effect if the publish goal is used.
# 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
java_version = 17

# Gradle daemon improves build performance
org.gradle.daemon=true

# Enable parallel builds for faster compilation
org.gradle.parallel=true
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Loading
Loading