-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.36, Pipeline Maven Plugin 0.4
I'm not able to use withMaven step inside docker container.
[Pipeline] withMaven $ docker exec ffff env printenv MAVEN_HOME $ docker exec ffff env printenv M2_HOME $ docker exec ffff env /bin/sh -c "which mvn" Using maven exec: /opt/apache-maven-3.3.9/bin/mvn Using global settings config with name MavenGlobal Replacing all maven server entries not found in credentials list is false [Pipeline] { [Pipeline] sh [test-XXX] Running shell script nohup: failed to run command `sh': No such file or directory [Pipeline] } [Pipeline] // withMaven
My Jenkinsfile pipeline:
node('docker') { stage('Checkout') { checkout scm } buildInDocker('linux') { stage('Maven') { withMaven(globalMavenSettingsConfig: '11111111-2222-3333-4444-555555555555') { sh 'mvn clean test' } } } }
It looks like PATH env gets overwritten.
- is related to
-
JENKINS-41339 Environment variables referencing other variables broken
-
- Reopened
-
-
JENKINS-47823 withMaven fails to inject Maven settings files with docker-pipeline 1.14
-
- Closed
-
-
JENKINS-47809 Docker container does not read maven settings.xml after updating
-
- Resolved
-
- relates to
-
JENKINS-41204 pipeline does not use docker environment
-
- Open
-
-
JENKINS-43590 docker.inside() breaks container environment.
-
- Open
-
-
JENKINS-48050 Replace Declarative Docker agent directive with new implementation
-
- In Progress
-
- links to
- mentioned in
-
Page Loading...
I cant test with beta ATM, however, the fix looks good on my sample basic declarative pipeline. I need do
here is the result of your request
[INFO]
Effective user-specific configuration settings:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2017-11-08T01:04:15 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective Settings for '?' on '58a31892ecc5' -->
<!-- -->
<!-- ====================================================================== -->
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0">/space/jenkins/skysandbox/workspace/pipeline-test/?/.m2/repository</localRepository>
<pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
<pluginGroup>org.apache.maven.plugins</pluginGroup>
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
</settings>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.352 s