-
Notifications
You must be signed in to change notification settings - Fork 598
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
Multi-release JAR with module-info.java #804
Multi-release JAR with module-info.java #804
Conversation
Now I see a few builds are failing. It looks like the JDK8 build cancels the rest of the test builds. There are three ways fixing it:
What is your opinion? |
@hadrabap I believe number 3 is the best option. |
Honestly i don't know. I personally hate Maven, and would much prefer to use Gradle, with which i have experience with multi-release jars and toolchains. I've never used Maven toolchains.
Probably best to have this in another PR, and explain the rationale and provide context also.
We already required JDK11 to run Spotless. I think we could make JDK11 mandatory for building, and use the |
I was checking about Maven Toolchains, the problem i see is that the path of each JDK needs to be specified manually. That's a problem because everyone has a different path on their machine, and the plugin cannot find the JDK by using a discovery mechanism. That's a big drawback compared to the Gradle Java toolchains. Github Actions setup-java now supports Maven Toolchains, but that doesn't solve the problem for individual developers. |
There are no such problems. The Toolchain plug-in is used just by the developer of the project. Consumers can see the references to it in the POM, but Maven does not take care. When depending on another project Maven reads |
I don't understand, if you installed your JDK in a different folder than my JDK, the |
The
which says use JDK which version is up to 1.8 inclusive (JDK8 effectively) and
which means any JDK which version is higher or equal to 9 (JDK11, JDK17, JDK18…) The consumers don't need to deal with this at all (if they are not using Maven Toolchain themselves). They just need to use appropriate JVM which understands the byte code level of the classes in the dependent JAR — in our case any JVM from version 8 including. This Apache page is quite nice, This page describes version range Let me summarize on an example. Project B uses (depends on) Project A. Roles involved:
If Project A is not using Toolchains and Project B is not using Toolchains => nobody needs to deal with Toolchains; Developer of Project A nor Developer of Project B. If Project A is not using Toolchains and Project B is using Toolchains => Developer of Project A does not need to deal w/ Toolchains; Developer of Project B must deal with it. If Project A is using Toolchains and Project B is not using Toolchains => Developer of Project A must deal with Toolchains; Developer of Project B does not need to deal with it. If Both Projects are using Toolchains => Both of them must deal with it. In other words: Toolchains are local to project and their usage is not transitive in the sense of Maven dependency. The only issue in our case is that when we decide to switch to Toolchains all contributors will be forced to do the same. Consumers are not affected. Hope this helps. |
That's what i was missing ! But if someone never set or used toolchains, then it won't work. I think it's not very intuitive, no? For instance i don't have a |
Yes, it fails if the configuration file is missing or does not provide JDK requested by the project. |
That's what I'm afraid of, we have so many contributors for this project, I don't want to add more impediments by using toolchains |
Agree. What we can do is to use single JDK build. I've checked that even JDK19 can still build release 8. Question remains about JDK23 which will be the next LTS; but lets forget about it for now, we have plenty of time. You said that JDK11 is already mandatory due to some testing stuff or alike, don't you? Give me go-ahead and I'll clean-up the POM. :-) |
It's mentioned in the contributing instructions, jdk 11 is required to run the spotless maven plugin. You could rebase your PR, I have updated all the plugins today! |
Since I added Maven enforcer today to enforce minimum maven version maybe we can use that to enforce minimum jdk version? https://maven.apache.org/enforcer/enforcer-rules/requireJavaVersion.html This will also need updating in that case https://github.com/xerial/sqlite-jdbc/blob/master/CONTRIBUTING.md#prerequisites And we need to amend the CI job to drop jdk 8 and use jdk 11 instead for all the jobs that were on 8 |
All done. The only problem is with one test which seems to be crashing from something who-knows-whats-going-on. The tests seem to be fine, but the JVM did something bad… |
…plete modular descriptor
Yes, the release flag for 8. Will do so tomorrow |
which one would that be? i see CI is green now |
It started at
It is the previous run as of writing this. The log has the following message:
I have the complete log downloaded and can provide it to you if necessary. Interesting thing is that the second run was successful. Another explanation could be issues on GitHub site. It got extremely slow and I faced lots of out-of-available-servers errors. |
If a rerun ends up passing, it should be fine :) |
LOL 😆 Sounds deterministic to me 😁 |
should only care when it's effectively flaky |
Now done. |
So we have one last open question. What shall I do next? Any ideas, improvements? |
The module name ? I am fine with |
@hadrabap is there some rework you need to do, or is this ready for merging? |
@gotson From my side it's complete and ready for merge. |
My bad, i was looking at the wrong place -_- |
The Look for |
@gotson Well, we have issue with JavaDoc. I have a fix for it. Where should I put it? New PR? Or do you want to handle it on your own? The fix is simple: adding |
Hello @xerial, @gotson and others!
I tried to implement
module-info.java
(#790). I decided to go the multi-release way.What I had to do is:
maven-compiler-plugin
to support multirelease and the new<release />
configuration optionmaven-bundle-plugin
to understand multirelease JARsNext, I don't know if you are using Maven Toolchains, so I left the version selection commented out. Tell me if I should remove them.
Finally, I also registered other JDBC entrypoints via service loader like
DataSource
to enable automatic configuration in Jakarta EE Containers (Glassfish, OpenLiberty) or others. Once again, it is not necessary. If you don't like it, I'll remove it.Please tell me your opinion about this.
With best regards,
PETR