Search code examples
mavenjenkins

Configure Maven installation in Jenkins per individual job


Is there a way to configure Jenkins to use specific Maven installation per job?
e.g.
Job A - Maven 3.3.3
Job B - Maven 3.3.9


Solution

  • Jenkins allows you to select which Maven installation to use per job. You can setup multiple installations of Maven, multiple settings configurations of Maven to be exact, through Manage JenkinsConfigure System.

    Then to configure per job, in Jenkins, select your specific build job and choose Configure. From there, assuming it is a Maven project build, you should have option(s) under the Build section (might have to hit the Advanced button) where you can select the Maven settings for your installation you want.

    khmarbaise's comment is very valid, though. Unless you have a very specific reason to downgrade Maven for a given job, your build shouldn't be too reliant on what minor versions of the build tool to use.