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

Docker warning included in maven command path

XMLWordPrintable

      Not sure what has changed in our environment, but we've recently started having builds that use maven fail.  It appears that a docker warning is included in the maven command, and the end result is a "No such file or directory" error when executing mvn.

       

      For reference, the Jenkinsfiles look similar to this:

      dockerRun('maven:3-openjdk-16') {
        withMaven() {
          sh "$MVN_CMD clean verify"
        }
      }
      

      And the output looks like:

      [Pipeline] withMaven
      [withMaven] Available options: 
      [withMaven] IMPORTANT "withMaven(){...}" step running within a Docker container. See Pipeline Maven Plugin FAQ in case of problem.
      [withMaven] using JDK installation provided by the build agent
      [withMaven] using Maven global settings.xml 'foobar' with Maven servers credentials provided by Jenkins (replaceAll: true): [mavenServerId: 'foobar', jenkinsCredentials: 'foo', username: 'foo', type: 'UsernamePasswordCredentialsImpl'], [mavenServerId: 'foo', jenkinsCredentials: 'foo', username: 'foo', type: 'UsernamePasswordCredentialsImpl']
      $ docker exec 94f4f948285e59e0799e6346681dea01b6511b5201f6911e017821389b97e3d7 printenv MAVEN_HOME
      [withMaven] using Maven installation provided by the build agent with the environment variable MAVEN_HOME=WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release /usr/share/maven
      [Pipeline] {
      [Pipeline] dir
      Running in /home/jenkins/workspace/abc123
      [Pipeline] {
      [Pipeline] sh
      + /home/jenkins/workspace/abc123_master_tmp/withMaven7d83a85b/mvn clean verify
      ----- withMaven Wrapper script -----
      /home/jenkins/workspace/abc123_master_tmp/withMaven7d83a85b/mvn: line 3: WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release /usr/share/maven/bin/mvn: No such file or directory
      

      It looks like the command for maven is becoming "WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release /usr/share/maven/bin/mvn"  instead of "/usr/share/maven/bin/mvn".

       

      The docker warning should be written to stderr, so not sure why it's being captured by docker exec printenv MAVEN_HOME.

            Unassigned Unassigned
            bpfoster Ben Foster
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: