Configuring an Ant project for execution
Let's configure an project in Jenkins static code analysis, compilation of files, creation of a package file, and archiving it so you can use it later in another build job or project.
Getting ready
You have already created an Ant project in Jenkins in Chapter 1, Getting Started with Jenkins in the recipe Creating a Freestyle Job for an Ant project.
How to do it...
- Go to
Jenkins
dashboard |Ant
project |General
section. - Select
Discard old builds
| ConfigureMax # of builds to keep
(to avoid many builds and disk space):

- Go to
Build
|Add build step
|Invoke Ant
| ProvideTargets
based on thebuild.xml
:

- Go to
Post-build Actions
|Add post-build action
|Archive the artifacts
. - Provide the of the
.WAR
file that needs to be so another project can utilize the package file if required:

- Click on
Build now
. - Go
Console Output
(as shown in the following screenshot) and verify the build execution log for all the operations or that we have configured:

- Go to
Project...