Skip to content

Commit 2ae6c6b

Browse files
Improve handling of the Java version.
* Added gradle toolchain support. * Updated GH gradle build action. * Small improvements to Maven POM.
1 parent 1b44e4a commit 2ae6c6b

File tree

4 files changed

+49
-35
lines changed

4 files changed

+49
-35
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
- name: Build with Gradle
4242
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
4343
with:
44-
arguments: build
44+
arguments: build -Pjava_version=${{ matrix.jdk }}

build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ plugins
1212
group = 'com.ibm.cicsdev.springboot'
1313
archivesBaseName='cics-java-liberty-springboot-jcics'
1414
version = '0.1.0'
15-
sourceCompatibility = '1.8'
16-
1715

1816
// If in Eclipse, add Javadoc to the local project classpath
1917
eclipse
@@ -30,6 +28,15 @@ repositories
3028
mavenCentral()
3129
}
3230

31+
java
32+
{
33+
toolchain
34+
{
35+
languageVersion = JavaLanguageVersion.of(java_version)
36+
vendor = JvmVendorSpec.IBM
37+
implementation = JvmImplementation.J9
38+
}
39+
}
3340

3441
dependencies
3542
{

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
# These values only have any effect if the publish goal is used.
1414
# For example: gradle build publish.
1515
publish_repo_releases_url = 'default-value-for-publish_repo_releases_url'
16-
publish_repo_releases_name = 'default-value-for-publish_repo_releases_name'
16+
publish_repo_releases_name = 'default-value-for-publish_repo_releases_name'
17+
java_version = 8

pom.xml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<project
2-
xmlns="http://maven.apache.org/POM/4.0.0"
1+
<project
2+
xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
@@ -10,17 +10,22 @@
1010
<artifactId>spring-boot-starter-parent</artifactId>
1111
<version>2.7.0</version>
1212
</parent>
13-
13+
1414
<!-- Application properties -->
1515
<groupId>com.ibm.cicsdev.springboot</groupId>
1616
<artifactId>cics-java-liberty-springboot-jcics</artifactId>
1717
<version>0.1.0</version>
1818
<name>cics-java-liberty-springboot-jcics</name>
19-
<description>Demo JCICS project for Spring Boot</description>
19+
<description>CICS Spring Boot Appliaction - JCICS Example</description>
20+
2021
<properties>
2122
<java.version>1.8</java.version>
23+
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<maven.compiler.target>${java.version}</maven.compiler.target>
26+
<maven.compiler.source>${java.version}</maven.compiler.source>
2227
</properties>
23-
28+
2429
<!-- CICS TS V5.5 BOM (as of May 2020) -->
2530
<dependencyManagement>
2631
<dependencies>
@@ -33,29 +38,30 @@
3338
</dependency>
3439
</dependencies>
3540
</dependencyManagement>
36-
37-
<dependencies>
38-
<!-- Compile against, but don't include JCICS in the final build (version and scope are from BOM) -->
41+
42+
<dependencies>
43+
<!-- Compile against, but don't include JCICS in the final build (version and scope are from
44+
BOM) -->
3945
<dependency>
4046
<groupId>com.ibm.cics</groupId>
4147
<artifactId>com.ibm.cics.server</artifactId>
4248
</dependency>
43-
44-
<!-- Spring Boot web support -->
49+
50+
<!-- Spring Boot web support -->
4551
<dependency>
4652
<groupId>org.springframework.boot</groupId>
4753
<artifactId>spring-boot-starter-web</artifactId>
48-
</dependency>
49-
50-
<!-- Compile against, but don't include Tomcat in the runtime build -->
54+
</dependency>
55+
56+
<!-- Compile against, but don't include Tomcat in the runtime build -->
5157
<dependency>
52-
<groupId>org.springframework.boot</groupId>
53-
<artifactId>spring-boot-starter-tomcat</artifactId>
54-
<scope>provided</scope>
58+
<groupId>org.springframework.boot</groupId>
59+
<artifactId>spring-boot-starter-tomcat</artifactId>
60+
<scope>provided</scope>
5561
</dependency>
5662
</dependencies>
57-
58-
<!-- Package as an executable war (default is jar) -->
63+
64+
<!-- Package as an executable war (default is jar) -->
5965
<packaging>war</packaging>
6066
<build>
6167
<plugins>
@@ -65,8 +71,8 @@
6571
</plugin>
6672
</plugins>
6773
</build>
68-
69-
<!--
74+
75+
<!--
7076
Publishes artifacts to here if the deploy goal is used.
7177
7278
The values here can be passed on the maven command line
@@ -75,15 +81,15 @@
7581
for example:
7682
-Dpublish_repo_snapshots_name=my-repo
7783
-->
78-
<distributionManagement>
79-
<snapshotRepository>
80-
<id>${publish_repo_snapshots_name}</id>
81-
<url>${publish_repo_snapshots_url}</url>
82-
</snapshotRepository>
83-
<repository>
84-
<id>${publish_repo_releases_name}</id>
85-
<url>${publish_repo_releases_url}</url>
86-
</repository>
87-
</distributionManagement>
84+
<distributionManagement>
85+
<snapshotRepository>
86+
<id>${publish_repo_snapshots_name}</id>
87+
<url>${publish_repo_snapshots_url}</url>
88+
</snapshotRepository>
89+
<repository>
90+
<id>${publish_repo_releases_name}</id>
91+
<url>${publish_repo_releases_url}</url>
92+
</repository>
93+
</distributionManagement>
8894

89-
</project>
95+
</project>

0 commit comments

Comments
 (0)