Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Jena's initialization is implemented using the ServiceLoader mechanism. This is respected when Neptune's JDBC driver repackages Jena.
However, when Jena is relocated under the shadow namespace
shadow.org.apache.jena
, this namespace is not reflected in theMETA-INF/services/shadow.org.apache.jena.sys.JenaSubsystemLifecycle
provider-configuration file, where the original namespace (i.e.org.apache.jena
) is used.Moreover, when packaging the Neptune JDBC driver, Jena is minimized. Since the ServiceLoader providers (i.e.
shadow.org.apache.jena.riot.system.InitRIOT
,shadow.org.apache.jena.sparql.system.InitARQ
, andshadow.org.apache.jena.sys.InitJenaCore
) aren't referenced statically, they aren't included in the minimized package, which prevents Jena's dynamic initialization.Description
Rewriting fully qualified class names in the provider-configuration file can be addressed by
mergeServiceFiles()
that usesServiceFileTransformer
.Jena's dynamically loaded ServiceLoader providers can be included by excluding Jena from minimization, similarly to the other exclusions currently used.
Related Issue
#243
Additional Reviewers
@birschick-bq
@xiazcy
@alexey-temnikov
@kylepbit
@Cole-Greer