Maven fulfills the need to build a standard project layout. In addition, it allows proceeding quickly on a new project and reduces the configuration needs while boosting the build report automatically.
Maven plug-ins are included in almost all Jenkins releases. You need to have at least one Maven installation.
- Configure Maven installation by navigating to Manage Jenkins->Configure System.
- In the ‘Maven Installation’ section, click the ‘Add’ button.
- Provide a name and choose the version from the drop down, as shown below.
- Jenkins will install the given version anytime it’s required.
- Create a new Maven job by clicking ‘New Job’ on the left side of the menu.
- Provide a suitable name and select the option ‘Build a Maven 2/3 project.
- On the job configuration screen, provide the SCM and Maven goals to call.
- Select the SCM and specify the Maven targets to call.
- Click ‘Build Now’.
- On the ‘Build Executor Status’, click the progress bar. You will notice Jenkins install Maven.
- Check your project. The output should look something as shown below.
- After the project is built, you can navigate to project page->Modules link on the left.
- For each module, Jenkins will display the following:
- Module’s workplace link
- Artifacts
- Test result trend
- Recent changes
You may also like: How to Configure Email Notification in Jenkins?