jenkins the definitive guide

(Jeff_L) #1

Figure 13.5. Displaying project disk usage over time


13.2.2. Disk Usage and the Jenkins Maven Project Type


If you are using the Jenkins Maven build jobs, there are some additional details you should know about.
In Jenkins, Maven build jobs will automatically archive your build artifacts by default. This may not
be what you intend.


The problem is that these SNAPSHOT artifacts take up space—a lot of it. On an active project, Jenkins
might be running several builds per hour, so permanently storing the generated JAR files for each build
can be very costly. The problem is accentuated if you have multimodule projects, as Jenkins will archive
the artifacts generated for each module.


In fact, if you need to archive your Maven SNAPSHOT artifacts, it is probably a better idea to deploy
them directly to your local Maven repository manager. Nexus Pro, for example, can be configured to
do this and Artifactory can be configured to delete old snapshot artifacts.


Fortunately, you can configure Jenkins to this, go to the “Build” section of your build job configuration
screen and click on the Advanced button. This will display some extra fields, as shown in Figure 13.6,
“Maven build jobs—advanced options”.


Figure 13.6. Maven build jobs—advanced options

Free download pdf