[MWRAPPER-133] MAVEN_CONFIG populated by Jenkins Maven Pipeline is no longer read,
- Dominant language
- Java
- Stars
- 254
- Forks
- 78
- Avg merge
- 5h 26m
- Merged PRs (30d)
- 2
Description
**[Rocher Suchard](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rocher.suchard)** opened **[MWRAPPER-133](https://issues.apache.org/jira/browse/MWRAPPER-133?redirect=false)** and commented
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:
```bash
$ mvn wrapper:3.3.0:wrapper -Dmaven=3.9.6
1. use scripts-only
$ grep -r MAVEN_CONFIG mvnw mvnw.cmd .mvn/
1. nothing
$ mvn wrapper:3.2.0:wrapper -Dmaven=3.9.6
1. 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% %*
```
Is there a way to do the same for the script-only if this is to be the default ?
---
**Affects:** 3.3.0
4 votes, 10 watchers
Contributor guide
No contributing guide indexed for this repository
Research direction
Compare the generated script-only mvnw and mvnw.cmd files from Maven Wrapper 3.3.0 with the bin wrapper output and the older 3.2.0 scripts. Start by tracing how MAVEN_CONFIG is incorporated in the bin scripts; done means the script-only wrapper also reads that environment variable for custom Maven settings, on both supported script platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100