Another option is to pass the parameter into the build script as a property value. The following is a more
involved example from a Maven POM file. In this example, Maven is configured to deploy a specific
WAR file. We provide the version of the WAR file to be deployed in the target.version property,
which is used in the dependency declaration, as shown below:
...
<dependencies>
<dependency>
<groupId>com.wakaleo.gameoflife</groupId>
<artifactId>gameoflife-web</artifactId>
<type>war</type>
<version>${target.version}</version>
</dependency>
</dependencies>
<properties>
<target.version>RELEASE</target.version>
...
</properties>
When we invoke Maven, we pass in the parameter as one of the build properties (see Figure 10.5,
“Adding a parameter to a Maven build job”). We can then use a tool like Cargo to do the actual
deployment—Maven will download the requested version of the WAR file from the local Enterprise
Repository Manager, and deploy it to an application server.
Figure 10.5. Adding a parameter to a Maven build job
That, in a nutshell, is how you can integrate build job parameters into your build. In addition to plain
old String parameters, however, there are a few more sophisticated parameter types, that we will look
at in the following paragraphs (see Figure 10.6, “Many different types of parameters are available”).