Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Maven installation in Jenkins per individual job

Tags:

maven

jenkins

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

like image 343
Sayid Avatar asked Sep 05 '25 03:09

Sayid


2 Answers

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.

like image 51
alexanderific Avatar answered Sep 09 '25 18:09

alexanderific


For newer Jenkins versions, management of Maven installations is placed here:

Manage Jenkins → Global Tool Configuration → section Maven.

Per job configuration: "Maven Version" dropdown placed in "Build" section.

like image 41
joro Avatar answered Sep 09 '25 19:09

joro