jenkins the definitive guide

(Jeff_L) #1
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wakaleo.gameoflife</groupId>
<artifactId>gameoflife-deploy-with-jenkins</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.wakaleo.gameoflife</groupId>
<artifactId>gameoflife-web</artifactId>
<type>war</type>d
<version>${target.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>gameoflife</warName>
<overlays>
<overlay>
<groupId>com.wakaleo.gameoflife</groupId>
<artifactId>gameoflife-web</artifactId>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<target.version>RELEASE</target.version>
</properties>
</project>

Next, we configure a Jenkins build job to invoke this pom.xml file using a property value provided by
the user (see Figure 12.11, “Deploying an artifact from a Maven repository”). Note that we have set
the default value to RELEASE so that, by default, the most recent release version will be deployed.
Otherwise, the user can provide the version number of the version to be deployed or redeployed.

Free download pdf