操作系统:虚拟机安装CentOS-7-x86_64-DVD-1810.iso
Remote root directory:/home/admin/jenkins
Launch method:Launch agent by connecting it to the master
1. 离线安装Git
虚拟机硬件CD/DVD连接使用CentOS-7-x86_64-DVD-1810.iso,将其中的
复制到临时目录,在此目录下,使用root用户运行:rpm -ivh *.rpm --nodeps --force
使用git version
验证版本。
2. mvn command not found / node: No such file or directory
本地使用mvn、npm正常,而jenkins运行命令失败,创建软链接解决:
node:
ln -s "$(which node)" /usr/bin/node
maven:
ln -s "$(which mvn)" /usr/bin/mvn
ln -s "$(which mvn)" /usr/local/bin/mvn
3. No compiler is provided in this environment. Perhaps you are running on a JRE rather than…
Jenkins默认使用系统自带openjdk: /usr/lib/jvm/java…
需要将java路径添加到pipeline中:
environment {
PATH = "/usr/local/jdk1.8/bin:$PATH" #定义java的环境变量
}
4. Permission denied
请保证配置linux构建环境时使用用户与Jenkins运行时用户一致,保证Jenkins调用命令涉及的文件(夹)均为本用户所有。
示例:更改maven文件(夹)所属用户为admin,使用root用户执行:
chown -R admin maven
标签:bin,node,常见问题,用户,usr,Linux,jenkins,mvn
From: https://www.cnblogs.com/flyer-me/p/16734927.html