-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure explicit Java module descriptors #359
Conversation
Use the ModiTect plugin to add module descriptors while retaining Java 8 compatibility.
|
<goal>add-module-info</goal> | ||
</goals> | ||
<configuration> | ||
<jvmVersion>9</jvmVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm how this and the --multi-release=9
line below interacts with the 1.8 compiler target? I just want to be sure we don't break 1.8 compatibility.
Thanks for this @aalmiray. My only comment (above) is wanting to ensure that we don't break 1.8 compatibility. |
Understood. This is how classes would look like once packaged:
The build was run with Java 11. The single class with bytecode 53 is
|
I have had multi-release packaging of other dependencies break my Java 8 builds (of my system that uses Failsafe), not because the multi-release jar was incompatible with Java 8, but because the published I have been able to work around this using special Ivy configurations, and would probably be able to figure out how to do the same in this case, but it almsot certainly will be a hit. I want proponents of Java modules to recognize that keeping compatibility is a lot harder than it appears at first blush. |
Do you happen to know why the pom.xml was not compatible with Ivy? In the case of this PR the change is found inside the |
I don't know enough about Maven pom files to give an authoritative answer, but here's the line I had to change in my
This stopped working until I changed it to:
You could reasonably say that it's not such a big deal, but it took me a long time to figure this out, and until I did, I was shut out of updating to the latest release of StreamEx. I am reasonably confident that a similar transformation would work if Failsafe goes this route, but I don't know for sure. There are probably others who, for various reasons, are stuck on Java 8 and who don't directly use Maven but depend on its ecosystem. |
It looks like streamex-0.8.0 explicitly changed its packaging go "multirelease-jar" https://central.sonatype.com/artifact/one.util/streamex/0.8.0 This was a conscious decision of the author to modify the companion metadata (pom.xml) and has nothing to do with the actual JAR contents. ModiTect does not alter in any way the chosen packaging, rest assured the fix you had to put in place for streamex was explicit for that version alone. |
Fingers crossed. |
Thanks for this @aalmiray! Also, jarviz is a great little tool! |
This was released in Failsafe 3.3.1. |
Thank you for merging and releasing 😁 |
Use the ModiTect plugin to add module descriptors while retaining Java 8 compatibility.
Fix for #358
NOTE: The release must be run with Java9+ or else it will fail to generate module descriptors. The CI workflow runs tests with
8
,11
, and17
which is fine as long as thepackage
phase is not invoked.