commit | ca551e033b7165736c7fbe860507206d39f8844f | [log] [tgz] |
---|---|---|
author | Konrad Windszus <kwin@apache.org> | Sat Dec 23 11:34:56 2023 +0100 |
committer | GitHub <noreply@github.com> | Sat Dec 23 11:34:56 2023 +0100 |
tree | f46602fd5bfe80fd65dc4849482b017f7f6e4153 | |
parent | 437a0d4a8e2d1dbe33ff02de168807513954b2f1 [diff] |
Update readme.md Fix badges
This module contains a Bnd plugin enforcing that no class of the current bundle extends or implements a provider type. Note that using a provider type (i.e. calling its methods without implementing or extending it) is still allowed (even for consumers).
That ensures that the import-package
version ranges are not narrow but broad and the risk that the bundle is incompatible with newer versions of its dependent bundles is less likely.
For usage with Maven the Bnd plugin has to be added to the plugin dependencies of bnd-maven-plugin
(or maven-bundle-plugin
) like this:
<plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-maven-plugin</artifactId> <extensions>true</extensions> <dependencies> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.providertype.bnd-plugin</artifactId> <version>1.0.0</version> </dependency> </dependencies> </plugin>
In addition the bnd.bnd
file needs to register the Bnd plugin with the plugin instruction
-plugin.providertype:org.apache.sling.providertype.bndplugin.ProviderTypeScanner
To explicitly ignore certain provider types (i.e. don't fail when these are extended/implemented) one can use the attribute ignored
with one or multiple comma-separated fully qualified provider type names. For example
-plugin.providertype:org.apache.sling.providertype.bndplugin.ProviderTypeScanner;ignored=org.apache.jackrabbit.api.security.user.User
bnd-maven-plugin
version 6.0.0+ or maven-bundle-plugin
version 5.1.5+)The information whether a type (i.e. a class or interface) is designed to be extended/implemented only by providers or also by consumers is determined originally from the the annotations @org.osgi.annotation.versioning.ProviderType
or @org.osgi.annotation.versioning.ConsumerType
. In order to speed up the check the annotation is evaluated and extracted into a dedicated JSON file named META-INF/api-info.json
when generating the apis jar and being looked up from there within this plugin.