Generate module-info, fix build on JDK11+#324
Generate module-info, fix build on JDK11+#324stevehu merged 2 commits intonetworknt:masterfrom handcraftedbits:master
Conversation
|
@handcraftedbits I don't see any problem with the update; however, I want to test on the Java 6 build on your repo to ensure that it is backward compatible. We still have a lot of users stuck with early version of Andriod and we have to support them. BTW, are you building the library on your own? What is your use case to support Java 11 build? Thanks a lot for your help. |
|
Yes, I'm building it for my own standalone project that uses JDK9+. Thanks! |
|
FYI, I had one more change. I bumped |
|
@handcraftedbits While building the release on jdk8, I got the following error. Meanwhile, I have to remove the plugin manually to release it. Could you please take a look at it? Thanks. To reproduce it. |
This PR makes
json-schema-validatorwork better with JDK9+ w.r.t. modularization and a couple build fixes for JDK11+:commons-langis bumped from3.5to3.7so the generatedmodule-infocan point to a fixed module name (instead of using an "automatic module name" determined from the JAR's filename, which is a discouraged practice).slf4j-apiwas not bumped because the next version with any module support is2.0.0-alpha1, which I figured was too drastic of a version bump.moditect-maven-pluginis added to build amodule-info.classclass file which serves as the module descriptor. This works even during a JDK8 build becausemoditect-maven-pluginwill generate the.classfile itself and place it underMETA-INF/versions/9, making this a multi-release JAR. JDK8 will ignoremodule-infoat runtime and JDK9+ will make use of it.maven-javadoc-pluginandjacoco-maven-pluginhad their versions bumped to support JDK11+.Edit: when I said JDK8, that's the lowest version I tested on. I just noticed that JDK6 is the default build target for this project... I believe this should still work fine with the multi-release JAR trick.