Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Feature Model Launcher 1.2.2
-
None
Description
With SLING-10956 we now have an assembly which allows us to drop in additional extensions and/or dependencies in the lib directory and have them located by the Feature Launcher using the ServiceLoader mechanism.
That mechanism does not work for the content extension. This extension is special because the handler it provides - https://github.com/apache/sling-org-apache-sling-feature-extension-content/blob/master/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java - is supposed to override the buit-in handler from https://github.com/apache/sling-org-apache-sling-feature-launcher/blob/master/src/main/java/org/apache/sling/feature/launcher/impl/extensions/handlers/ContentPackageHandler.java .
It seems that the way the classpath is created by the launcher script does not allow 'extension' jars to override classes provided by the main jar file. I have looked at the ServiceLoader javadoc and it states that
When adding providers to the cache, the Iterator processes resources in the order that the ClassLoader.getResources(String) method finds the service configuration files.
In practice, I was only able to make the extension override the build-in handled by prepending it to the classpath.
Attachments
Issue Links
- links to