简体   繁体   English

Jenkins maven 构建在 linux 机器上失败

[英]Jenkins maven build fail in linux machine

My maven command execute fine in windows jenkins server but When i try to execute in linux machine,build got failed我的 maven 命令在 windows jenkins 服务器中执行得很好但是当我尝试在 linux 机器上执行时,构建失败了

I have tried Shell command build as belo w :我试过 Shell 命令构建如下

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=com.uhg.optum.acc:cores-binaries:%PLATFORM_CORE_VERSION% -DoutputDirectory=. -Dmdep.useBaseVersion=true

Console Output :控制台输出

[EnvInject] - Loading node environment variables. [EnvInject] - 加载节点环境变量。 Building remotely on BuildSwarm-6d98547c91e1-apsrp4109.uhc.com (docker-maven-slave) in workspace /home/jenkins/workspace/2.3.0 Deployment Artifacts (QualityMeasures-Platform) [2.3.0 Deployment Artifacts (QualityMeasures-Platform)] $ /bin/sh -xe /tmp/hudson3262693666907249961.sh + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=com.uhg.optum.acc:cores-binaries:%PLATFORM_CORE_VERSION% -DoutputDirectory=.在 BuildSwarm-6d98547c91e1-apsrp4109.uhc.com (docker-maven-slave) 上远程构建 /home/jenkins/workspace/2.3.0 部署工件 (QualityMeasures-Platform) [2.3.0 部署工件 (QualityMeasures-Platform) $ /bin/sh -xe /tmp/hudson3262693666907249961.sh + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=com.uhg.optum.acc:cores-binaries:%PLATFORMS%CORE -DoutputDirectory=. -Dmdep.useBaseVersion=true /tmp/hudson3262693666907249961.sh: line 2: mvn: command not found Build step 'Execute shell' marked build as failure Archiving artifacts Finished: FAILURE -Dmdep.useBaseVersion=true /tmp/hudson3262693666907249961.sh: line 2: mvn: command not found 构建步骤“执行 shell”将构建标记为失败存档工件完成:失败

Please help me请帮帮我

Seems like your shell script has failed since it can't find maven on this node.好像你的 shell 脚本失败了,因为它在这个节点上找不到 maven。 Check if you can see the maven installation directory defined on Manage Jenkins -> System Information as M2_HOME environment variable.检查是否可以看到Manage Jenkins -> System Information定义的 maven 安装目录作为M2_HOME环境变量。 You can also check at your terminal using env command.您还可以使用env命令在终端上进行检查。

Also %PLATFORM_CORE_VERSION% is used to dereference the environment variable under windows, use $PLATFORM_CORE_VERSION under Unix machines (as long as it configured)另外%PLATFORM_CORE_VERSION%用于windows下解引用环境变量,Unix机器下使用$PLATFORM_CORE_VERSION (只要配置好)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM