giulong opened a new pull request, #436:
URL: https://github.com/apache/maven-wrapper/pull/436
Following this checklist to help us incorporate your
contribution quickly and easily:
- [x] Your pull request should address just one issue, without pulling in
other changes.
- [x] Write a pull request description that is detailed enough to understand
what the pull request does, how, and why.
- [x] Each commit in the pull request should have a meaningful subject line
and body.
Note that commits might be squashed by a maintainer on merge.
- [x] Write unit tests that match behavioral changes, where the tests fail
if the changes to the runtime are not applied.
This may not always be possible but is a best-practice.
- [x] Run `mvn verify` to make sure basic checks pass.
A more thorough check will be performed on your pull request automatically.
- [x] You have run the integration tests successfully (`mvn -Prun-its
verify`).
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January
2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [x] I hereby declare this contribution to be licenced under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
---
# Problem
As per the [usage
docs](https://maven.apache.org/tools/wrapper/maven-wrapper-plugin/usage.html),
bumping the Maven version requires manually going on [Maven
Central](https://central.sonatype.com/artifact/org.apache.maven/apache-maven/versions)
to get the latest. It would be nice having the plugin resolve the highest
available version automatically.
# Proposed solution
Maven already supports [Dependency Version Requirement
Specification](https://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification),
allowing the definition of a range instead of a fixed one. Though it's not
advisable to rely on such a mechanism to manage regular dependencies of an
application for the sake of reproducible builds, the wrapper is an external
tool for which this issue doesn't apply.
Available Maven versions are taken from
[maven-metadata.xml](https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/maven-metadata.xml).
# Rationale
Having a native way to automatically bump the Maven version let us schedule
a simple wrapper execution. For instance:
* `./mvnw wrapper:wrapper -Dmaven=3.9.16`: fixed versions are considered
valid ranges, so no breaking change.
* `./mvnw wrapper:wrapper -Dmaven="[3.0,4.0-alpha)"`: allows the resolution
of the latest `3.x.x` version, excluding currently non-stable `4.x.x` versions.
Moreover, this is done without relying on external tools such as GitHub
actions (as proposed in #331) or bots like Renovate (as proposed in #249).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]