One of the great things about Maven is that it provides a standard project and build layout, along with a standard set of "goals." Not only does this make it easier for developers to get up to speed on a new project, but it also allows Jenkins to provide special support for Maven projects, reducing the configuration needed while enhancing the build report automatically. That is the goal of the Maven plugin for Jenkins .
The central feature of the Maven plugin for Jenkins is the Maven 2/3 project type. Thanks to the Maven project object model (POM), this project type can automatically provide the following features:
- Archive artifacts produced by a build
- Publish test results
- Trigger jobs for projects which are downstream dependencies
- Deploy your artifacts to a Maven repository
- Breakout test results by module
- Optionally rebuild only changed modules, speeding your builds
All of the above can be accomplished in Free style builds, but this requires more configuration on your part.
Requirements for Plugin Use
All Jenkins releases have the Maven plugin included. You must also have at least one Maven installation.
How to Use It
First, you must configure a Maven installation (this step can be skipped if you are using DEV@cloud). This can be done by going to the system configuration screen (Manage Jenkins-> Configure System). In the "Maven Installations" section, 1) click the Add button, 2) give it a name such as "Maven 3.0.3" and then 3) choose the version from the drop down.
- A link to the module's workspace
- The module's artifacts
- A clickable test result trend
- Recent changes (just for that module!)
Finally, if we had configured Jenkins to build any downstream dependencies of this project, they would automatically start building after this build completed.
If you are using the Maven plugin, you should also investigate the M2 Release Plugin for automating releases with one click. The M2 Extra Steps plugin will let you run arbitrary build steps before and after your build. Finally, the new Config File Provider plugin lets you maintain different settings.xml which can be referenced by your Maven builds.
Want to learn the latest in Jenkins? Subscribe to the Jenkins newsletter , Continuous Information . This monthly newsletter contains all of the latest interesting and useful happenings in the Jenkins community, sent directly to your inbox.
Stay up to date
We'll never share your email address and you can opt out at any time, we promise.