Skip to content
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

Adds explicit Java module descriptor #728

Merged
merged 1 commit into from Apr 29, 2023

Conversation

aalmiray
Copy link
Contributor

Resolves #727

Added moditect plugin in a profile guarded by a JDK activation because the plugin requires JDK9+
Tests on CI run on JDK8 and thus would cause a failure.

NOTE: This means releases must be performed with DJK9+

There was a previous configuration for the moditect plugin using en explicit module. I left in place in case you'd rather twek it instead of having the plugin create the module from scratch:

$ jarviz bytecode show --file target/json-schema-validator-1.0.80.jar 
subject: json-schema-validator-1.0.80.jar
Unversioned classes. Bytecode version: 52 (Java 8) total: 145
Versioned classes 9. Bytecode version: 53 (Java 9) total: 1

$ jarviz module descriptor --file target/json-schema-validator-1.0.80.jar 
subject: json-schema-validator-1.0.80.jar
name: com.networknt.schema
version: 1.0.80
open: false
automatic: false
exports:
  com.networknt.schema
  com.networknt.schema.format
  com.networknt.schema.uri
  com.networknt.schema.urn
  com.networknt.schema.utils
  com.networknt.schema.walk
requires:
  com.fasterxml.jackson.databind
  com.fasterxml.jackson.dataformat.yaml
  itu
  java.base mandated
  org.jruby.jcodings static
  org.jruby.joni static
  org.slf4j

Resolves networknt#727

Signed-off-by: Andres Almiray <aalmiray@gmail.com>
@stevehu
Copy link
Contributor

stevehu commented Apr 29, 2023

I didn't realize that we need to release with JDK9+. Is it possible to keep Java 8 with module support? Otherwise, I think we have to wait for the branches.

@aalmiray
Copy link
Contributor Author

Yes, that is what ModiTect does. Compiled bytecode remains Java 8 compatible as shown by the jarviz bytecode show call. However, the ModiTect plugin requires Java 9+ to run.

@stevehu stevehu merged commit cff8961 into networknt:master Apr 29, 2023
@aalmiray aalmiray deleted the java-modules branch April 29, 2023 15:29
@aalmiray
Copy link
Contributor Author

Thanks! 🚀

@stevehu
Copy link
Contributor

stevehu commented Apr 29, 2023

@aalmiray It works perfectly!!! I am learning new things every day. Thanks a lot. We will use Java 11 JDK for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Java Modules
2 participants