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

withMaven exits with unrecognized option --no-transfer-progress when using maven < 3.6.1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline-maven-plugin
    • None
    • Apache Maven 3.6.0
      pipeline-maven-plugin 1362.vee39a_d4b_02b_1
    • 1368.vfb_8509d7b_869

      JENKINS-51182 introduced `--no-transfer-progress` automatically to the maven command. This breaks when using maven < 3.6.1

      [2023-11-28T17:52:09.161Z] Unable to parse command line options: Unrecognized option: --no-transfer-progress
      [2023-11-28T17:52:09.161Z] 
      [2023-11-28T17:52:09.161Z] usage: mvn [options] [<goal(s)>] [<phase(s)>]
      [2023-11-28T17:52:09.161Z] 
      [2023-11-28T17:52:09.161Z] Options:
      [2023-11-28T17:52:09.161Z]  -am,--also-make                        If project list is specified, also
      [2023-11-28T17:52:09.161Z]                                         build projects required by the
      [2023-11-28T17:52:09.161Z]                                         list
      [2023-11-28T17:52:09.161Z]  -amd,--also-make-dependents            If project list is specified, also
      [2023-11-28T17:52:09.161Z]                                         build projects that depend on
      [2023-11-28T17:52:09.161Z]                                         projects on the list
      [2023-11-28T17:52:09.161Z]  -B,--batch-mode                        Run in non-interactive (batch)
      [2023-11-28T17:52:09.161Z]                                         mode (disables output color)
      [2023-11-28T17:52:09.161Z]  -b,--builder <arg>                     The id of the build strategy to
      [2023-11-28T17:52:09.161Z]                                         use
      [2023-11-28T17:52:09.161Z]  -C,--strict-checksums                  Fail the build if checksums don't
      [2023-11-28T17:52:09.161Z]                                         match
      [2023-11-28T17:52:09.161Z]  -c,--lax-checksums                     Warn if checksums don't match
      [2023-11-28T17:52:09.161Z]  -cpu,--check-plugin-updates            Ineffective, only kept for
      [2023-11-28T17:52:09.161Z]                                         backward compatibility
      [2023-11-28T17:52:09.161Z]  -D,--define <arg>                      Define a system property
      [2023-11-28T17:52:09.161Z]  -e,--errors                            Produce execution error messages
      [2023-11-28T17:52:09.161Z]  -emp,--encrypt-master-password <arg>   Encrypt master security password
      [2023-11-28T17:52:09.161Z]  -ep,--encrypt-password <arg>           Encrypt server password
      [2023-11-28T17:52:09.161Z]  -f,--file <arg>                        Force the use of an alternate POM
      [2023-11-28T17:52:09.161Z]                                         file (or directory with pom.xml)
      [2023-11-28T17:52:09.161Z]  -fae,--fail-at-end                     Only fail the build afterwards;
      [2023-11-28T17:52:09.162Z]                                         allow all non-impacted builds to
      [2023-11-28T17:52:09.162Z]                                         continue
      [2023-11-28T17:52:09.162Z]  -ff,--fail-fast                        Stop at first failure in
      [2023-11-28T17:52:09.162Z]                                         reactorized builds
      [2023-11-28T17:52:09.162Z]  -fn,--fail-never                       NEVER fail the build, regardless
      [2023-11-28T17:52:09.162Z]                                         of project result
      [2023-11-28T17:52:09.162Z]  -gs,--global-settings <arg>            Alternate path for the global
      [2023-11-28T17:52:09.162Z]                                         settings file
      [2023-11-28T17:52:09.162Z]  -gt,--global-toolchains <arg>          Alternate path for the global
      [2023-11-28T17:52:09.162Z]                                         toolchains file
      [2023-11-28T17:52:09.162Z]  -h,--help                              Display help information
      [2023-11-28T17:52:09.162Z]  -l,--log-file <arg>                    Log file where all build output
      [2023-11-28T17:52:09.162Z]                                         will go (disables output color)
      [2023-11-28T17:52:09.162Z]  -llr,--legacy-local-repository         Use Maven 2 Legacy Local
      [2023-11-28T17:52:09.162Z]                                         Repository behaviour, ie no use of
      [2023-11-28T17:52:09.162Z]                                         _remote.repositories. Can also be
      [2023-11-28T17:52:09.162Z]                                         activated by using
      [2023-11-28T17:52:09.162Z]                                         -Dmaven.legacyLocalRepo=true
      [2023-11-28T17:52:09.162Z]  -N,--non-recursive                     Do not recurse into sub-projects
      [2023-11-28T17:52:09.162Z]  -npr,--no-plugin-registry              Ineffective, only kept for
      [2023-11-28T17:52:09.162Z]                                         backward compatibility
      [2023-11-28T17:52:09.162Z]  -npu,--no-plugin-updates               Ineffective, only kept for
      [2023-11-28T17:52:09.162Z]                                         backward compatibility
      [2023-11-28T17:52:09.162Z]  -nsu,--no-snapshot-updates             Suppress SNAPSHOT updates
      [2023-11-28T17:52:09.162Z]  -o,--offline                           Work offline
      [2023-11-28T17:52:09.162Z]  -P,--activate-profiles <arg>           Comma-delimited list of profiles
      [2023-11-28T17:52:09.162Z]                                         to activate
      [2023-11-28T17:52:09.163Z]  -pl,--projects <arg>                   Comma-delimited list of specified
      [2023-11-28T17:52:09.163Z]                                         reactor projects to build instead
      [2023-11-28T17:52:09.163Z]                                         of all projects. A project can be
      [2023-11-28T17:52:09.163Z]                                         specified by [groupId]:artifactId
      [2023-11-28T17:52:09.163Z]                                         or by its relative path
      [2023-11-28T17:52:09.163Z]  -q,--quiet                             Quiet output - only show errors
      [2023-11-28T17:52:09.163Z]  -rf,--resume-from <arg>                Resume reactor from specified
      [2023-11-28T17:52:09.163Z]                                         project
      [2023-11-28T17:52:09.163Z]  -s,--settings <arg>                    Alternate path for the user
      [2023-11-28T17:52:09.163Z]                                         settings file
      [2023-11-28T17:52:09.163Z]  -t,--toolchains <arg>                  Alternate path for the user
      [2023-11-28T17:52:09.163Z]                                         toolchains file
      [2023-11-28T17:52:09.163Z]  -T,--threads <arg>                     Thread count, for instance 2.0C
      [2023-11-28T17:52:09.163Z]                                         where C is core multiplied
      [2023-11-28T17:52:09.163Z]  -U,--update-snapshots                  Forces a check for missing
      [2023-11-28T17:52:09.163Z]                                         releases and updated snapshots on
      [2023-11-28T17:52:09.163Z]                                         remote repositories
      [2023-11-28T17:52:09.163Z]  -up,--update-plugins                   Ineffective, only kept for
      [2023-11-28T17:52:09.163Z]                                         backward compatibility
      [2023-11-28T17:52:09.163Z]  -v,--version                           Display version information
      [2023-11-28T17:52:09.163Z]  -V,--show-version                      Display version information
      [2023-11-28T17:52:09.163Z]                                         WITHOUT stopping build
      [2023-11-28T17:52:09.163Z]  -X,--debug                             Produce execution debug output
      

          [JENKINS-72386] withMaven exits with unrecognized option --no-transfer-progress when using maven < 3.6.1

          Kyle Cronin added a comment -

          Originally reported this as an issue with maven 3.9 only to realize later the team was using an older 3.6.0 version of maven. Not sure if there is defined minimum version listed in the plugin docs, but the changes introduced with JENKINS-51182 (i.e. --no-transfer-progress) does imply a min version (not sure exactly when that option was introduced).

          Kyle Cronin added a comment - Originally reported this as an issue with maven 3.9 only to realize later the team was using an older 3.6.0 version of maven. Not sure if there is defined minimum version listed in the plugin docs, but the changes introduced with JENKINS-51182 (i.e. --no-transfer-progress ) does imply a min version (not sure exactly when that option was introduced).

          Mirko Tabor added a comment - - edited

          The problem described above ("Unable to parse command line options: Unrecognized option: --no-transfer-progress") also occurs with Maven 3.5.4

           

          The issue occurs with the "Pipeline Maven Integration" Plugin in Version: 1362.vee39a_d4b_02b_1.  After I reset/revert the plugin to version: 1345.va_0ef5530a_5ca_ the Maven call mentioned below works again.

           

          environment:

          Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)
          Maven home: d:\jenkins\tools\hudson.tasks.Maven_MavenInstallation\MVN_3.5.4\bin\..
          Java version: 1.8.0_362, vendor: Red Hat, Inc., runtime: D:\Tools\openJDK_1.8.0.362-redhat_64\jre
          Default locale: de_DE, platform encoding: Cp1252
          OS name: "windows server 2016", version: "10.0", arch: "amd64", family: "windows"

          Jenkins Version: 2.434 at Java: openjdk-17.0.8.1.1-redhat_64

          Example call:

          withMaven(
                          maven: 'MVN_3.5.4', 
                          mavenOpts: '-Xmx1024m -Dmaven.test.failure.ignore=false', 
                          mavenLocalRepo: '.repository',
                          options: [artifactsPublisher(disabled: true)], publisherStrategy: 'EXPLICIT') {
                                  bat "mvn clean package -q -B -pl AboutBox_Template -f pom.xml"
                          }

          I'm not sure if this issue is relevant:

          https://issues.apache.org/jira/browse/MRELEASE-1048 

          Mirko Tabor added a comment - - edited The problem described above ("Unable to parse command line options: Unrecognized option: --no-transfer-progress") also occurs with Maven 3.5.4   The issue occurs with the "Pipeline Maven Integration" Plugin in Version: 1362.vee39a_d4b_02b_1 .  After I reset/revert the plugin to version: 1345.va_0ef5530a_5ca_ the Maven call mentioned below works again.   environment: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00) Maven home: d:\jenkins\tools\hudson.tasks.Maven_MavenInstallation\MVN_3.5.4\bin\.. Java version: 1.8.0_362, vendor: Red Hat, Inc., runtime: D:\Tools\openJDK_1.8.0.362-redhat_64\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows server 2016", version: "10.0", arch: "amd64", family: "windows" Jenkins Version: 2.434 at Java: openjdk-17.0.8.1.1-redhat_64 Example call: withMaven(                 maven: 'MVN_3.5.4' ,                  mavenOpts: '-Xmx1024m -Dmaven.test.failure.ignore= false ' ,                  mavenLocalRepo: '.repository' ,                 options: [artifactsPublisher(disabled: true )], publisherStrategy: 'EXPLICIT' ) {                         bat "mvn clean package -q -B -pl AboutBox_Template -f pom.xml"                 } I'm not sure if this issue is relevant: https://issues.apache.org/jira/browse/MRELEASE-1048  

          Kyle Cronin added a comment -

          The original issue JENKINS-51182 should be solved with maven 4.0 using the `CI=true` env var. That doesn't really help other versions, just FYI.

          https://github.com/apache/maven/blob/4af662f7b3e5adcc6b03f3be7aa0f5fb4b8b644a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1480-L1481

          Kyle Cronin added a comment - The original issue JENKINS-51182 should be solved with maven 4.0 using the `CI=true` env var. That doesn't really help other versions, just FYI. https://github.com/apache/maven/blob/4af662f7b3e5adcc6b03f3be7aa0f5fb4b8b644a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1480-L1481

          Benoit added a comment -

          the `CI=true` env var

          which Jenkins set by itself
          Glad to read that with Maven 4, this would be automagically solved

          Benoit added a comment - the `CI=true` env var which Jenkins set by itself Glad to read that with Maven 4, this would be automagically solved

            bguerin Benoit
            kylecronin Kyle Cronin
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: