sszuev commented on issue #1556:
URL: https://github.com/apache/jena/issues/1556#issuecomment-1259798385

   > I'm not familiar with Gradle but it looks like you are maybe building a 
fat JAR with all your dependencies in it?
   > 
   > If this is the case then you are likely running into an issue that Jena 
initialisation is driven by `ServiceLoader` where each separate Jena library 
has a file in `META-INF/services` defining the system initialisers it uses. 
Your repackaging is likely picking only one of files (because the 
`ServiceLoader` mechanism requires they have the same name in every library JAR 
file) thus resulting in partial initialisation.
   > 
   > See https://jena.apache.org/documentation/notes/jena-repack.html for notes 
on how to successfully repack Jena into a fat JAR
   
   Indeed,
   with the described configuration I have following zip-entries in my jar:
   ```
   ==========================================
   META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle
   org.apache.jena.riot.system.InitRIOT
   org.apache.jena.sparql.system.InitARQ
   org.apache.jena.rdfs.sys.InitRDFS
   
   ==========================================
   META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle
   org.apache.jena.sys.InitJenaCore
   ```
   
   the `com.github.johnrengelman.shadow` plugin works fine, I have now single 
zip-entry with all 4 records inside.
   
   the official doc 
(https://jena.apache.org/documentation/notes/jena-repack.html) seems to be good 
enough,
   but probably a few more words can be added.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to