Integrate JDK9 module support#24
Integrate JDK9 module support#24kichik merged 4 commits intokichik:masterfrom concision:feat/jdk9-support
Conversation
|
Thanks! How do I reproduce this issue? I started a Docker container with I edited Your previous version had |
|
My apologies, I made a mistake last night when I tried to fix something and messed up some commits. Give me a moment and I will create a reproduction repository |
|
Do you think adding a manifest entry with the future module name will solve it too? It seems much simpler and doesn't require JDK 9. |
|
I have created a temporary repository over at I am not exactly sure why it is different from one of my other builds, but there is a lot more at play within that build. Using Docker inside of (Git) Bash, you can execute the following command in the root directory of the cloned project to reproduce it: MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/usr/src/pecoff4j" -w "/usr/src/pecoff4j" maven mvn packageIf you would prefer it, you might be able to use a manifest entry instead. I am not 100% sure how that plays out with module support (e.g. such as with JDK tools like edit: on second thought, both could be used - a manifest entry and |
|
Thanks, I was able to reproduce with your code. Looks like the inclusion of I am leaning towards a manifest line mostly because it's a simpler solution. I don't plan on adding any dependencies and it seems like we export everything anyway. The idea of including Also, do you have any input on the module name? I think |
|
A quick tl;dr on jlink --module-path target --add-modules me.concision.pecoff4j.warning --output jreWith the manifest entry, I received the following error: With I did not expect this behavior from Let me know how you wish to proceed, and I can update As for the module name, I think |
|
If that's the case, then I think we should just go ahead and drop Java 8 support. Whoever needs it can use 0.3.1. |
|
To clarify - do you mean dropping In the case of the latter, I do not think that is necessary - a jar can have a |
|
The latter. Dropping 8 altogether. I don't feel comfortable with including multiple class versions in the same JAR. |
|
I would not recommend unnecessarily dropping support - multi-release JARs are pretty commonplace in the Java/Maven ecosystem. Generally, the |
|
That's a cool trick. If it's truly as simple as described here, I'm up for it. Otherwise all the added complexity just to have Java 8 support is not quite worth it. This library doesn't get enough updates to worry about it. People who really need it will be able to use 0.3.1. |
|
I have updated this pull request to favor the multi-release route. Here is an overview of the changes:
These changes are relatively straightforward without any strange Maven hacks that are hard to maintain. I think these changes are ultimately better than the originally pitched changes and is a proper multi-release JAR with module support. Testing with the CLI tool Thanks for your patience and timely feedback on this PR. Let me know what your thoughts are from here. |
|
Thanks! This works great. It has been a real pleasure working with you on this PR. |
|
I'm not 100% sure it's related yet, but some JAR signing issue popped up when trying to release 0.3.2 with this change. |
|
Maven 🤷♂️ d31fc0a |
|
Thank you for going through the steps with me on this pull request! I appreciate the timely responses and open mind to these changes. Were you able to isolate the issue? Was it related to these changes in any way? |
|
Maybe? If you look into the logs of failed builds, you can see it recompiling the source code after building the JAR and signing it because "something changed". It then builds another JAR and submits that. |
This pull request adds Java 9 module support to this project. This resolves the following warning when using pecoff4j as a Maven dependency in Java 9+ projects:
Changes:
module-info.javathat exports all packages publicly with the module namecom.kichik.pecoff4j.module-info.class, prior to compiling the project again for Java 7. There is an obvious caveat that this compilation phase requires a JDK 9 installation or later to build the project. This phase is configured as a Maven profile that is optionally compiled with following behavour:< jdk 9, this module support is skipped and the artifact will not have Java 9 module support. A Maven warning is emitted to indicate this has occurred.>= jdk 9, the project will be compiled for Java 9 to generate amodule-info.class. The remaining classes will still be targeted for Java 7, however.These changes should be backwards compatible for running in
<= JRE 8.Any project maintainers are allowed to edit the source branch concision/pecoff4j feat/jdk9-support prior to merging, if any additional changes are needed.