[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885355#comment-17885355 ] Patrick Schmidt edited comment on MWRAPPER-133 at 9/27/24 2:57 PM: --- [~ralaoui], how does "{color:#172b4d}--batch-mode{color}" ending up in {{MAVEN_ARGS}} make your build fail? Since I'm also looking for a workaround, your comment makes me wonder what might ambush me down the line if I go with "MAVEN_ARGS=$MAVEN_CONFIG". Update: It seems the single quotes were the problem. I replaced the assignment with *_"MAVEN_ARGS=${env.MAVEN_ARGS} ${env.MAVEN_CONFIG}"_* and it works so far. In my case MAVEN_ARGS already contained something, so I appended MAVEN_CONFIG. was (Author: frettman): [~ralaoui], how does "{color:#172b4d}--batch-mode{color}" ending up in {{MAVEN_ARGS}} make your build fail? Since I'm also looking for a workaround, your comment makes me wonder what might ambush me down the line if I go with "MAVEN_ARGS=$MAVEN_CONFIG". > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17862689#comment-17862689 ] Réda Housni Alaoui edited comment on MWRAPPER-133 at 7/3/24 9:45 AM: - For the record, the workaround described in https://issues.apache.org/jira/browse/MWRAPPER-133?focusedCommentId=17845700&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17845700 generated a new issue with the latest Maven wrapper (3.3.2): {{--batch-mode}} flag (added by default by pipeline maven integration in {{MAVEN_CONFIG}} ) ends up in {{MAVEN_ARGS}}, which makes the build fail. was (Author: ralaoui): For the record, the workaround described in https://issues.apache.org/jira/browse/MWRAPPER-133?focusedCommentId=17845700&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17845700 generated a new issue with the latest Maven wrapper: {{--batch-mode}} flag (added by default by pipeline maven integration in {{MAVEN_CONFIG}} ) ends up in {{MAVEN_ARGS}}, which makes the build fail. > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17862689#comment-17862689 ] Réda Housni Alaoui edited comment on MWRAPPER-133 at 7/3/24 8:07 AM: - For the record, the workaround described in https://issues.apache.org/jira/browse/MWRAPPER-133?focusedCommentId=17845700&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17845700 generated a new issue with the latest Maven wrapper: {{--batch-mode}} flag (added by default by pipeline maven integration in {{MAVEN_CONFIG}} ) ends up in {{MAVEN_ARGS}}, which makes the build fail. was (Author: ralaoui): For the record, the workaround described in https://issues.apache.org/jira/browse/MWRAPPER-133?focusedCommentId=17845700&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17845700 generated a new issue with the latest Maven wrapper: {{--batch-mode}} flag ends up in {{MAVEN_ARGS}}, which makes the build fail. > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17845700#comment-17845700 ] Ashley Scopes edited comment on MWRAPPER-133 at 5/12/24 11:57 AM: -- We had the same issue, which was unfortunate. For us, we have a Groovy function that we reuse to inject our default Maven settings via the `withMaven` pipeline script plugin. To address this, we injected the fixed environment variables into the function. {code:groovy} // vars/withMavenConfig.groovy void call(Closure closure) { withMaven(...) { withEnv(["MAVEN_ARGS='${env.MAVEN_CONFIG}'"]) { closure() } } } {code} {code:groovy} pipeline { agent { label "master" } environment { ... } stages { stage("Run") { steps { script { withMavenConfig { sh("./mvnw -B clean verify") } } } } } } {code} This is far from ideal though... That being said, I feel that maybe Apache shouldn't have just totally removed this, and instead deprecated it explicitly and made the wrapper log a warning when encountered this, as this caused a lot of issues for us. was (Author: JIRAUSER291213): We had the same issue, which was unfortunate. For us, we have a Groovy function that we reuse to inject our default Maven settings via the `withMaven` pipeline script plugin. To address this, we injected the fixed environment variables into the function. {code:groovy} void withCommonMavenSettings(Closure closure) { withMaven(...) { withEnv(["MAVEN_ARGS='${MAVEN_CONFIG}'"]) { closure() } } } {code} This is far from ideal though... That being said, I feel that maybe Apache shouldn't have just totally removed this, and instead deprecated it explicitly and made the wrapper log a warning when encountered this, as this caused a lot of issues for us. > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839834#comment-17839834 ] Rocher Suchard edited comment on MWRAPPER-133 at 4/22/24 8:28 PM: -- {quote}so data from MAVEN_CONFIG will be duplicated on cmd by old wrapper{quote} I will try to see what wrapper script really receive (I assume it should contains something like {{-s }} but if this was really duplicated on our jenkins, I would have no need for this issue (I don't have access to the Jenkins plugin version). was (Author: rocher.suchard): {quote}so data from MAVEN_CONFIG will be duplicated on cmd by old wrapper{quote} I will try to see what wrapper script really receive (I assume it should MAVEN_CONFIG contains something like {{-s }} but if this was really duplicated on our jenkins, I would have no need for this issue (I don't have access to the Jenkins plugin version). > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839808#comment-17839808 ] Rocher Suchard edited comment on MWRAPPER-133 at 4/22/24 6:16 PM: -- [~sjaranowski] I don't know the history behind Jenkins Maven Pipeline and Maven Wrapper but the MAVEN_CONFIG is not something from Maven, but something found in the wrapper script directly (I do not check the cmd part because even as a Windows user, I loath to use batch and cmd file :)) : {code:bash|title=mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 -Dtype=bin} # shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" {code} versus {code:bash|title=mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6} exec_maven() { unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" } {code} As show above, {{$MAVEN_CONFIG}} is not there but it is present in the wrapper script in 3.2.0 : {code:bash|title=mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 -Dtype=script} # shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" {code} If there is a maven alternative (MAVEN_ARGS) why not, but from user standpoint, removing MAVEN_CONFIG is forcing user to 1) either stay with maven wrapper 3.2.0 2) either upgrade Jenkins or its maven pipeline (or other kind of pipeline) = complicated. was (Author: rocher.suchard): [~sjaranowski] I don't know the history behind Jenkins Maven Pipeline and Maven Wrapper but the MAVEN_CONFIG is not something from Maven, but something found in the wrapper script directly (I do not check the cmd part because even as a Windows user, I loath to use batch and cmd file :)) : {code:bash|title=mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 -Dtype=bin} # shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" {code} versus {code:bash|title=mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6} exec_maven() { unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" } {code} The {{$MAVEN_CONFIG}} is not there but it is present in the wrapper script in 3.2.0 : {code:bash|title=mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 -Dtype=script} # shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" {code} If there is a maven alternative (MAVEN_ARGS) why not, but from user standpoint, removing MAVEN_CONFIG is forcing user to 1) either stay with maven wrapper 3.2.0 2) either upgrade Jenkins or its maven pipeline (or other kind of pipeline) = complicated. > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPE
[jira] [Comment Edited] (MWRAPPER-133) MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
[ https://issues.apache.org/jira/browse/MWRAPPER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839607#comment-17839607 ] Slawomir Jaranowski edited comment on MWRAPPER-133 at 4/22/24 10:49 AM: {{MAVEN_CONFIG}} looks like undocumented feature in 3.x we have {{MAVEN_ARGS}} in 3.9.x and 4.x {{script-only}} simply call destination maven script so should it works https://maven.apache.org/configure.html was (Author: slawekjaranowski): {{MAVEN_CONFIG}} looks like undocumented feature in 3.x we have {{MAVEN_ARGS}} in 3.9.x and 4.x {{script-only}} simply call destination maven script so should it works > MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read, > --- > > Key: MWRAPPER-133 > URL: https://issues.apache.org/jira/browse/MWRAPPER-133 > Project: Maven Wrapper > Issue Type: Bug > Components: Maven Wrapper Scripts >Affects Versions: 3.3.0 >Reporter: Rocher Suchard >Priority: Major > > Hello, > Due to an update by Renovate in one of our project, I've seen some error > related to internal dependencies not being picked up by Maven : while we were > using a custom settings, it did not use it and was using Central instead of > our Artifactory. > Upon analysis, it seems that Maven Pipeline define a MAVEN_CONFIG > environnement variable here : > https://github.com/jenkinsci/pipeline-maven-plugin/blob/8cfaff9c021c971d19e5469c553a86d954c05387/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L400 > The MAVEN_CONFIG variables was used in our Maven 3.2.0 Wrapper script and > I've played around with the default value and type: > {code:bash} > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 > # use scripts-only > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > # nothing > $ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6 > # use bin > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% % > $ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6 -Dtype=bin > ... > [INFO] Unpacked bin type wrapper distribution > org.apache.maven.wrapper:maven-wrapper-distribution:zip:bin:3.3.0 > [INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.6 > and download from https://repo.maven.apache.org/maven2 > ... > $ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/ > mvnw:MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" > mvnw: ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" > mvnw.cmd: %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* > {code} > Is there a way to do the same for the script-only if this is to be the > default ? -- This message was sent by Atlassian Jira (v8.20.10#820010)