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
3.2.5
<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
description
<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
17
<properties>
<java.version>17</java.version>
</properties>
Dependencies
The dependencies
jcommander
jackson-core
reactor-netty-http
spring-boot-starter-validation
groupId
artifactId
version
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
spring-boot-maven-plugin
cics-bundle-maven-plugin
cics-bundle-maven-plugin
bundle-war
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
M2_HOME
#!/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
@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