Reputation: 1973
My maven command execute fine in windows jenkins server but When i try to execute in linux machine,build got failed
I have tried Shell command build as below :
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. 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=. -Dmdep.useBaseVersion=true /tmp/hudson3262693666907249961.sh: line 2: mvn: command not found Build step 'Execute shell' marked build as failure Archiving artifacts Finished: FAILURE
Please help me
Upvotes: 0
Views: 2760
Reputation: 3914
Seems like your shell script has failed since it can't find maven on this node. Check if you can see the maven installation directory defined on Manage Jenkins -> System Information
as M2_HOME
environment variable. You can also check at your terminal using env
command.
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)
Upvotes: 2