-
Notifications
You must be signed in to change notification settings - Fork 30
Description
New feature, improvement proposal
The existing version parameter of the select-jdk-toolchain goal current requires one to specify a version range or an exact version.
As far as I can tell it's not possible to specify just the desired major version.
If I want to have any JDK-21 (but only 21) I have to specify the version as [21,22).
This is easy for hard-coded versions, but if the version is derived from another parameter (e.g. maven.compiler.release), then one needs to start calculating in the configuration and that's not trivial with Maven.
Therefore my proposal is to introduce something like a majorVersion parameter that expects an integer number and is internally translated into a version requirement of [${majorVersion},${majorVersion+1}).
This would be similar to the version element in a JDK toolchain:
https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html
In general it would be possible to make the exiting version parameter behave like a majorVersion field in case it has a integer value. But maybe this would break existing users that expect the current behavior?
If you agree I can provide a PR for it.