错误:无法解析POM - Linux

时间:2018-06-13 14:05:38

标签: java maven jenkins

我正在尝试在我正在设置的新主人上运行作业时遇到错误。在Jenkins配置中配置的JDK和Maven存在于Linux服务器上。 (基于groovy的其他工作没有问题) 詹金斯:1.636 Java:1.8 操作系统:RHEL 7 詹金斯创业使用jenkins.war

错误Stacktrace:

Parsing POMs
maven31-agent.jar already up to date
maven31-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[feature-123] $ java -cp /apps/user123/jenkins/jenkins-slave/maven31-agent.jar:/aim/gfs/quad/3rd/apache-maven/3.2.1/common/boot/plexus-classworlds-2.5.1.jar:/aim/gfs/quad/3rd/apache-maven/3.2.1/common/conf/logging jenkins.maven3.agent.Maven31Main /aim/gfs/quad/3rd/apache-maven/3.2.1/common /apps/user123/jenkins/jenkins-slave/slave.jar /apps/user123/jenkins/jenkins-slave/maven31-interceptor.jar /apps/user123/jenkins/jenkins-slave/maven3-interceptor-commons.jar 33293
No JDK named ‘null’ found
[feature-123] $ /bin/sh -xe /tmp/hudson2658511214746764047.sh
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "java" (in directory "/apps/user123/jenkins/jenkins-slave/workspace/feature-123"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)

1 个答案:

答案 0 :(得分:0)

最后了解了根本原因。从站启动期间未初始化路径变量。主设备未被从设备接收。因此,在从属启动期间,必须初始化PATH。 就这么简单。我一直专注于主配置和设置,而不关注Slave启动。

此代码段可解决此问题:

PATH="/java_home/bin:$PATH"
nohup java -jar /path_to_slave/slave.jar ........