jenkins build 报错: mvn: command not found 解决

pandaphinex 2020-06-11

jenkins build 报错:

[hello-world-freestyle] $ /bin/sh -xe /root/softs/apache-tomcat-9.0.35/temp/jenkins5323864766359302328.sh
+ mvn clean package
/root/softs/apache-tomcat-9.0.35/temp/jenkins5323864766359302328.sh: line 2: mvn: command not found
Build step ‘Execute shell‘ marked build as failure
Finished: FAILURE1、查询系统环境变量: echo $PATH

[_0_8_centos ~]# echo $PATH
  /root/jenkins_home/downloads/apache-maven-3.6.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

 2. 在jenkins中设置环境变量:

【系统管理】->【系统设置】->【全局属性】->【环境变量】

jenkins build 报错: mvn: command not found 解决

相关推荐