Dynamically apply Add-Opens directives from MANIFEST.MF
#322
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.
Currently, people testing with Java 17 must add an awkward
-DargLine=directive with theAdd-Opensmodules from the core version they are testing. This PR applies a trick to dynamically set this based on the values inMANIFEST.MF.With this in place, anyone with a sufficiently recent core (2.341+), test harness (1721.v385389722736+), and
maven-hpi-plugin(this PR) should be able to effortlessly do Java 17 testing and indeed enable Java 17 in theirJenkinsfile. Once this is merged, I will try to do a release and wrap this and the test harness change into a new plugin POM release so that the requirement just becomes "core 2.341+ and plugin POM 4.40+".Tested with
workflow-joband Java 17: