How to configure Maven installation in Jenkins per individual Slave node?

For me, the solution was to go to Manage Jenkins -> Global Tool Configuration, and set up maven there. You can access this via /configureTools (ex: http://your-ip:8080/jenkins/configureTools )

Example: Maven installations

  • Name: my_maven_3.3.9
  • MAVEN_HOME: /usr/share/maven

Additional configurations for other common tools at /configureTools :

Git installations

  • Name: my_git_2.11.0
  • Path to Git executable: /usr/bin/git

JDK installations

  • Name: my_jdk_1.8.0_161
  • JAVA_HOME: /opt/jdk/jdk1.8.0_161

Assuming you have Java and Maven installed on your slave:

  1. Go to Manage Jenkins -> Manage Nodes
  2. Click configure icon on the node you wish to configure
  3. Scroll down to 'Node Properties' and tick the 'Tool Locations' checkbox
  4. Fill in the options for Java and Maven.

It should now work (even if you have configured a Maven installation on the master).


If you do NOT add Maven to the Master configuration and you just install it on every slave with their own possibly different environment variables (example with version 3.2.5)

M2_HOME=C:\apache-maven-3.2.5
M2=C:\apache-maven-3.2.5\bin
Path+=;C:\apache-maven-3.2.5\bin

then every Jenkins slave will just use Maven with local settings.