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

withMaven fails to create mvn wrapper in DinD context

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • pipeline-maven-plugin
    • None
    • pipeline-maven-plugin 3.8.2
      docker-pipeline-plugin 1.21
      docker-plugin 1.1.9

      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

            Unassigned Unassigned
            cpottiers Cyril Pottiers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: