Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support keeping private maven registry for maven wrapper in only-script mode #32213

Open
rarkins opened this issue Oct 30, 2024 Discussed in #32172 · 0 comments
Open

Support keeping private maven registry for maven wrapper in only-script mode #32213

rarkins opened this issue Oct 30, 2024 Discussed in #32172 · 0 comments
Labels
manager:maven-wrapper Related to the maven-wrapper manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Oct 30, 2024

Discussed in #32172

Originally posted by schuch October 28, 2024
When renovate suggests updates to the Maven wrapper, it does not retain hostnames of an internal Maven registry in the distributionUrl parameter.
The distributionUrl parameter is important if the wrapper is used in only-script mode, which is the new default.

The following wrapper modes1 are available:

  • only-script (new default since mvnw 3.32)
  • script
  • bin (the old default i think)
  • source

Example of a wrapper.properties file with only-script mode:

wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://fqdn.of.internal.registry/internal-repo1-mirror-name/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

Currently renovate scans the wrapper.properties file for the Pattern /^(.*?)\/org\/apache\/maven\/wrapper\/3 to extract the existing registry's fqdn. But this pattern does only match, if the wrapper is used in the bin mode. (wrapperUrl property). Renovate then forcefully sets MVNW_REPOURL to repo.maven.apache.org which cannot be overridden by the renovate user.

I would be nice, if renovate would support retaining the registry hostname for the only-script mode, like it does for the bin mode4.

Reproduction

You can see that Renovate is changing the distributionUrl. In the example, the public registry URL https://repo1.maven.org/maven2 (vs. https://repo.maven.apache.org/maven2) was used for the test, as the update command mvn wrapper:wrapper would otherwise not run successfully with a real private URL. But I think you get the idea, because the distributionUrl should have remained stable in this case as well.

Footnotes

  1. Documentation about the wrapper modes: https://maven.apache.org/wrapper/#usage-with-or-without-binary-jar

  2. Maven Wrapper 3.3 Release Notes: https://github.com/apache/maven-wrapper/releases/tag/maven-wrapper-3.3.0

  3. Relevant line of code: https://github.com/renovatebot/renovate/blob/87152d36e1f011fad38eb6fd73ed7f664f3ca0bd/lib/modules/manager/maven-wrapper/artifacts.ts#L188

  4. Related Issue that lead to introduction of the feature to keep the internal registry hostname in bin mode: https://github.com/renovatebot/renovate/issues/20064

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:maven-wrapper Related to the maven-wrapper manager labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:maven-wrapper Related to the maven-wrapper manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

1 participant