mvn: not found jenkins: If you are running a Maven/Spring project in Jenkins and you are using the shell script option to run some maven command like :

mvn spring-boot:run
// or
mvn clean

and you got this the build error :

/Users/Shared/Jenkins/tmp/jenkins8087926087546049217.sh: line 3: mvn: command not found

Try this solution :

Import the maven path variable before execute the mvn command

export MAVEN_HOME=/var/jenkins_home/maven/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin
mvn --version
mvn clean package

Read also : Solution for : You must define the following mandatory properties for ‘Unknown’: sonar.projectKey

Tagged:

Laisser un commentaire