EnforceBytecodeVersion
fails with "Restricted to JDK 11 yet […] contains […] targeted to JDK 17"
#582
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.
End-to-end testing of Text Finder with a Jenkins core compiled with
-Dmaven.compiler.release=17
showed that #578 was incomplete: since theinitialize
logic ran after the Enforcer logic, the Enforcer logic still used the lowest supported Java version (not the automatically detected one) and failed. Fixed by moving theinitialize
logic to thevalidate
file. This has the added benefit of making the code more readable by putting the (related) logic that writes the marker file and the logic that updates the value in-memory to an adjacent location in the same file.Testing done
Built a Jenkins core with
-Dmaven.compiler.release=17
, then ranmvn clean verify
in Text Finder with that core and tip-of-trunkmaven-hpi-plugin
vs this PR. At tip-of-trunk, it failed with the Enforcer error shown above; with this PR it passes.