We have a Jenkins slave that runs build jobs using Maven. The .m2 directory exists in the root folder of the user, but the mvn command does not work on the command line. Does this mean that Jenkins is set to auto-install tools on the slave? If so how could I configure that machine to allow me to run builds by hand.
You need to add the following environtment variables (as user or system variables)
For example, this is my configuration on CentOS
export JAVA_HOME=/opt/java/jdk1.6.0_43
export PATH=${JAVA_HOME}/bin:${PATH}
export M2_HOME=/opt/apache/maven
export PATH=${M2_HOME}/bin:${PATH}
Then you can check using mvn --version
on your shell
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.