Managing Java dependencies using Gradle or Maven

When writing your own build scripts for Java development, you can use build toolchains such as Gradle or Maven to resolve Java dependencies. As an alternative to the IBM® CICS® SDK for Java™ , they can retrieve libraries from a remote repository or allow-listed local repositories. After finishing coding, you can use the CICS-provided Gradle and Maven plug-ins to build and deploy a CICS bundle that includes your Java application.

Gradle and Maven are supported by most Java integrated development environments (IDEs) and automation tools such as Jenkins and Travis CI. Therefore, you can integrate the compilation, building, and deployment of applications into a pipeline more easily during development.

What artifacts are available

These artifacts are provided by CICS on Maven Central:

Table 1. CICS-provided artifacts on Maven Central
Group ID Artifact ID Description
com.ibm.cics com.ibm.cics.ts.bom

The bill of materials (BOM) that defines the versions of all the artifacts to ensure they are at the same CICS TS level.

Tip:

You're recommended to use the BOM to control the version numbers of the other CICS-provided dependencies and omit version numbers from their declarations.

In Maven, the BOM also provides the correct dependency scope to avoid clashes with runtime-provided libraries. You're recommended to use the BOM to control the scope of dependencies and omit scopes from their declarations.

See how to use with Gradle or use with Maven.

com.ibm.cics.server

The CICS Java class library (JCICS), a Java library that provides the EXEC CICS API support for Java applications in CICS TS.

See how to use with Gradle or use with Maven.

com.ibm.cics.jcicsx

The JCICSX API classes that support a subset of CICS functions, available in CICS TS 5.6 or later.

The classes can be run remotely and are easier to mock and stub than the Java classes of JCICS. The JCICSX API classes can be used together with the JCICS API, but only the commands that use JCICSX can benefit from those enhanced features.

See how to use with Gradle or use with Maven.

com.ibm.cics.server.invocation.annotations

CICS annotations, a Java library that provides the @CICSProgram annotation to enable CICS programs to invoke Java applications in a Liberty JVM server.

See how to use with Gradle or use with Maven.

com.ibm.cics.server.invocation

The CICS annotation processor, a Java library that is used during compilation to create metadata that enables CICS programs to invoke Java applications in a Liberty JVM server.

See how to use with Gradle or use with Maven.

What's next

It is important that the correct Gradle configuration or Maven scope is used for each dependency you reference. This can avoid runtime conflicts as well as keeping the size of the application smaller. To find out more, see Declaring Java dependencies using Gradle or Declaring Java dependencies using Maven.