Skip to content
Advertisement

Maven not found in Jenkins

I am running my Maven/Spring project in Jenkins (just testing it out, first time) using the shell script option with:

mvn spring-boot:run

I get the build error: /Users/Shared/Jenkins/tmp/jenkins8087926087546049217.sh: line 2: mvn: command not found

How can I fix this? Its a Spring-boot app. It works fine when I run mvn spring-boot:run via command line.

Advertisement

Answer

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 path in MAVEN_HOME and save configurations.

Maven config in Jenkins

Advertisement