[JIRA] (JENKINS-61080) withMaven fails to create mvn wrapper in DinD context

2 views
Skip to first unread message

cpottiers@gmail.com (JIRA)

unread,
Feb 13, 2020, 9:22:03 AM2/13/20
to jenkinsc...@googlegroups.com
Cyril Pottiers created an issue
 
Jenkins / Bug JENKINS-61080
withMaven fails to create mvn wrapper in DinD context
Issue Type: Bug Bug
Assignee: Alvaro Lobato
Attachments: build.log
Components: pipeline-maven-plugin
Created: 2020-02-13 14:21
Environment: pipeline-maven-plugin 3.8.2
docker-pipeline-plugin 1.21
docker-plugin 1.1.9
Priority: Blocker Blocker
Reporter: Cyril Pottiers

I am trying to launch a maven container from an docker cloud agent.

The withMaven instruction failed to get MAVEN_HOME, M2_HOME env variables and which mvn command.

The consequence is that the mvn wrapper is not created in the MVN_CMD_DIR and so the globalSettings not injected when build with mvn command...

 

node("my-jenkinsagent-alpine") { // Linux alpine agent with the Docker daemon and jdk8
    sh "docker version"
    docker.image('maven').inside { // Docker image with Maven installed
        withMaven(globalMavenSettingsConfig: 'default-maven-settings') {
            git 'https://github.com/cyrille-leclerc/my-jar.git'
            sh 'ls -al ${MVN_CMD_DIR}'
            sh 'export PATH=$MVN_CMD_DIR:$PATH && mvn clean deploy'
        }
    }
}

build.log

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages