Github user christopher-johnson commented on the issue:

    https://github.com/apache/jena/pull/401
  
    Compilation in JPMS requires a `module-info.java` and is distinct from 
compiling in JDK 9+.  
    
    > What is the issue here? Does anything break?
    
    A quick background of the use case might help here.  I have been developing 
JPMS support for the TrellisLDP project recently and have encountered several 
blocking dependency issues resulting from `jena-osgi`, which is a [transitive 
dependency 
](https://github.com/apache/commons-rdf/blob/master/commons-rdf-jena/pom.xml#L68-L72)
 resulting from `org.apache.commons.rdf.jena` that is a direct dependency of 
the `org.trellisldp.app.triplestore` implementation.  JPMS compilation is 
strict and cannot resolve a class-containing package sourced from multiple 
"parent modules" (even if the package is private).[1]   A good question here 
that you raise is what happens if a top level package contains no classes and 
only exports subpackages.  This requires further investigation and I do not 
know whether this semi-split, semi-private package, multi-module configuration 
works, but it is probably not advisable according to the requirements of the 
[specification](http://openjdk.java.net/projects/jigs
 aw/spec/reqs/#non-interference).
    
    Regarding this PR, I am running tests now.  BTW, for me, the shaded-guava 
jar does not work.   I do not know whether it is my IDE, JRE or the maven build 
configuration.  At any rate, I can run tests if I replace the shaded-guava with 
a direct dependency.  Also, `guava 21.0` does not work (without hacking) in a 
JDK10 because it depends on  `javax.annotation.Nullable`.  (it seems that 
`guava 24.1-jre` removes the problematic jsr-305 annotations).
    
    There seems to be an initialization/lifecycle issue that can be seen when 
running `TestFactoryRDF`.  The first test to fail there is 
`factoryRDF_triple_01` with this exception 
`java.lang.ExceptionInInitializerError`.
    also 
    `com.google.common.util.concurrent.ExecutionError: 
java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.jena.riot.system.RiotLib` is reported.
    
    The preceding tests pass.  It could be my issue, though as an 
initialization related, it could be a consequence of a the changes in this PR:
    
    `java.lang.ExceptionInInitializerError` is also produced in a test runtime 
use of `org.apache.jena.arq` by a `org.trellisldp.vocabulary` test:
    ```
    java.lang.ExceptionInInitializerError
           
org.apache.jena.riot.RDFParserBuilder.buildFactoryRDF(RDFParserBuilder.java:597)
           
org.apache.jena.riot.RDFParserBuilder.build(RDFParserBuilder.java:569)
           
org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:512)
           
org.trellisldp.vocabulary.AbstractVocabularyTest.getVocabulary(AbstractVocabularyTest.java:56)
           
org.trellisldp.vocabulary.AbstractVocabularyTest.testVocabulary(AbstractVocabularyTest.java:62)
    ```
    
    [1] 
https://stackoverflow.com/questions/40616739/java-9-overlapping-non-exported-packages


---

Reply via email to