Maven not found in Jenkins Maven not found in Jenkins jenkins jenkins

Maven not found in Jenkins


"Manage Jenkins"->"Global Tool Configuration"enter image description here

if still not work, add the following to "Execute shell"

export MAVEN_HOME=/opt/mavenexport PATH=$PATH:$MAVEN_HOME/binmvn --versionmvn clean package

enter image description here


Try this, Navigate to Manage Jenkins and click on Global Tool Configuration, In Maven section click on the 'Add Maven' button and provide the maven installation pathin MAVEN_HOME and save configurations.

Maven config in Jenkins


I had a similar problem on windows. Maven worked fine from console, but failed when called as cmd command from Jenkins.

The reason is that Jenkins is installed and run as a ‚system user‘ service. This means the process can‘t see the ENV variables and PATH of your user (user level). Setting up maven in PATH and ENV variables on system level makes the trick.

P.S.: @Charo the maven config moved from Configure System to Global Tool Configuratin in newer Jenkins versions