Open alberndt opened 1 year ago
I have replicated this issue. It is worth nothing that projects like AEM WCM Core Components are still using the maven-bundle-plugin and not bnd-maven-plugin.
Either of the solutions proposed by @alberndt works.
Bnd instructions should use the format outlined in https://bnd.bndtools.org/chapters/820-instructions.html:
bnd instruction is a property that starts with a minus sign (‘-‘)
That implies using the properties format <name>: <value>
Expected Behaviour
a Sling Context-Aware configuration can be used
Actual Behaviour
An interface annotated as
org.apache.sling.caconfig.annotation.Configuration
is not found by the bnd-processThe issue can be fixed, if the current bnd-configuration (main pom.xml)
is changed to
see merged bnd-instructions (chapter 33.2 Merged Instructions at https://bnd.bndtools.org/chapters/820-instructions.html)
alternatively all plugins can be specified in a single line
In the current version only the ModelsScannerPlugin is used. By changing the order of the lines, only the ConfigurationClassScannerPlugin is used. So the last -plugin instruction wins.
Steps to Reproduce
Add a Context-aware configuration to core, and the built bundle should have 2 Manifest-Headers
Platform and Version
AEMaaCS, MacOS w. M1 chip - but probably all platforms
PS: I could create a Pull-Request, which also includes a sample CA-Config.
kind regards, Alexander Berndt