Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61080

withMaven fails to create mvn wrapper in DinD context

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: pipeline-maven-plugin
    • Labels:
      None
    • Environment:
      pipeline-maven-plugin 3.8.2
      docker-pipeline-plugin 1.21
      docker-plugin 1.1.9
    • Similar Issues:

      Description

      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

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              alobato Alvaro Lobato
              Reporter:
              cpottiers Cyril Pottiers
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: