How to Build Maven with Jenkins?

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.

  1. Configure Maven installation by navigating to Manage Jenkins->Configure System.
  2. In the ‘Maven Installation’ section, click the ‘Add’ button.
  3. Provide a name and choose the version from the drop down, as shown below.

Jenkins Version

  1. Jenkins will install the given version anytime it’s required.
  2. Create a new Maven job by clicking ‘New Job’ on the left side of the menu.
  3. Provide a suitable name and select the option ‘Build a Maven 2/3 project.

Maven Build

  1. On the job configuration screen, provide the SCM and Maven goals to call.
  2. Select the SCM and specify the Maven targets to call.

SCM

SCM

  1. Click ‘Build Now’.
  2. On the ‘Build Executor Status’, click the progress bar. You will notice Jenkins install Maven.
  3. Check your project. The output should look something as shown below.

Console Output

  1. After the project is built, you can navigate to project page->Modules link on the left.

Modules

  1. For each module, Jenkins will display the following:

You may also like: How to Configure Email Notification in Jenkins?

SHARE THIS

Get A Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.