Skip to main content

Building the Z-OS Connect Customer Services Interface with Maven

Intro

This document explains how Maven is used in the src/Z-OS-Connect-Customer-Services-Interface/ directory. It will cover the configuration and usage of Maven in this specific context.


Project Definition

The src/Z-OS-Connect-Customer-Services-Interface/pom.xml file starts with the XML declaration and the project definition, specifying the model version and the XML namespace for Maven POM.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright IBM Corp. 2023 -->
<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>


Parent Project

The parent project is defined as spring-boot-starter-parent with version 3.2.5. This allows the project to inherit dependencies and plugins from the Spring Boot parent POM.

	<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>


Project Coordinates

The project coordinates are defined with groupId, artifactId, version, packaging, name, and description. This uniquely identifies the project and provides metadata.

	<groupId>com.ibm.cics.cip.bank.springboot</groupId>
<artifactId>customerservices</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>customerservices</name>
<description>Springboot project utilising Z/OS Connect</description>


Properties

The properties section defines the Java version to be used, which is set to 17.

	<properties>
<java.version>17</java.version>
</properties>


Dependencies

The dependencies section lists all the dependencies required by the project. This includes various libraries such as jcommander, jackson-core, reactor-netty-http, spring-boot-starter-validation, and more. Each dependency is defined with its groupId, artifactId, version, and scope.

	<dependencies>

<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.82</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>


Build Plugins

The build section defines the plugins used during the build process. This includes the spring-boot-maven-plugin for building Spring Boot applications and the cics-bundle-maven-plugin for creating CICS bundles. The cics-bundle-maven-plugin is configured to execute the bundle-war goal with a specific jvmserver.

	<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.ibm.cics</groupId>
<artifactId>cics-bundle-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<goals>
<goal>bundle-war</goal>
</goals>
<configuration>
<jvmserver>CBSAWLP</jvmserver>
</configuration>
</execution>
</executions>
</plugin>


Maven Wrapper Script

The mvnw script is a shell script for running Maven with the Maven Wrapper. It ensures that the correct version of Maven is used and handles various environment configurations. It checks for the presence of JAVA_HOME and M2_HOME, sets up the classpath, and executes the Maven Wrapper main class.

#!/bin/sh
#
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------



Maven Wrapper Batch Script

The src/Z-OS-Connect-Customer-Services-Interface/mvnw.cmd script is a batch script for running Maven on Windows with the Maven Wrapper. It performs similar functions to the mvnw script, including checking for JAVA_HOME, setting up the project base directory, and executing the Maven Wrapper main class.

@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human