Split JDK min version from enforcer min version #106
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a "works in most cases" to fix a build error when trying to still preserve Java 8 compatibility.
Context: I'm the maintainer of the sonar-groovy plugin, which still uses this parent. I currently want to keep Java 8 compatibility, while updating the build infrastructure. (See Inform-Software/sonar-groovy#170)
The problem is now this:
1.8.0-352
or11.0.17
So using
1.8
asjdk.min.version
breaks the compiler on Java 11 and using8
asjdk.min.version
makes the enforcer plugin throw an error on Java 8 (since8
>1.8
).Splitting this into two properties (with one deriving from the other by default) serves two purposes:
jdk.min.version
to11
creates a versionenforcer.jdk.min.version
of1.11
, which is still bigger then1.8
and smaller then11
(and we are pretty sure nobody uses anything in-between)This can probably be dropped some months after the next LTS release, when Java 11 is the baseline for all projects based on this.