描述:构建时文件没有传输过去,控制台报以下错误
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [tomcat-服务器] ...
SSH: EXEC: STDOUT/STDERR from command [/webdir/tomcat/bin/startup.sh] ...
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
SSH: EXEC: completed after 201 ms
SSH: Disconnecting configuration [tomcat-服务器] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
Parsing POMs原因:找不到tomcat服务器的jdk,实际上tomcat已经配好环境变量了,怀疑是jenkins没找到,故将jdk/bin目录下的文件链接到/usr/bin/,重启Jenkins,正常使用
ln -s /usr/local/jdk1.8/bin/* /usr/bin/再次运行,成功
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [tomcat-服务器] ...
SSH: EXEC: STDOUT/STDERR from command [/webdir/tomcat/bin/startup.sh] ...
Tomcat started.
SSH: EXEC: completed after 201 ms
SSH: Disconnecting configuration [tomcat-服务器] ...
SSH: Transferred 1 file(s)
Parsing POMs
另外,在Jenkins里面也要配jdk
![]()
![]()

版权声明:本文为gaofeng2017原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。