I'm having trouble getting a Maven Eclipse project to build in both Maven and Eclipse. The problem appears to be that the JSON validation library com.networknt wants to be required (in module-info.java) as requires com.networknt.schema in Maven, but as requires json.schema.validator in Eclipse (as Maven project). Each build simply cannot see the module if it is named the other way. I can build in Eclipse if I "run as maven build..." but that doesnt help coding or JUnit test debug etc.
I have the following in my pom:
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.4.3</version>
</dependency>
I'm using 1.4.3 from https://mvnrepository.com/artifact/com.networknt/json-schema-validator
Anyone know what's up here?
com.networknt:json-schema-validator:1.4.3
is a multi-release JAR with themodule-info.class
not included in the root of the JAR, but asMETA-INF/versions/9/module-info.class
. Themodule-info.class
is compiled as Java 9 bytecode, the rest as Java 8 bytecode. Eclipse seems not support this. For details and a workaround see my comment here.module-info.class
must be located in the root of the jar file... Also I would check the most recent version of that: central.sonatype.com/artifact/com.networknt/… version 1.5.0 that's issue of the json-schema-validator jar ... or the project behind it... Created an issue for the project: github.com/networknt/json-schema-validator/issues/1089module-info.class
located only inMETA-INF/versions/9
and not in the root: "A multi-release modular need not have a module descriptor at the located root. In this respect a module descriptor would be treated no differently to any other class or resource file. This can ensure that, for example, only Java 8 versioned classes are present in the root area while Java 9 versioned classes (including the module descriptor) are present in the 9 versioned area."