Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
maven-ipojo-plugin 1.12.0
Description
Here are the steps:
- create a bundle (say "Stereotype") that exports package test.ipojo.stereotype containing
- the MyInterface interface
- the MyComponent annotation:
@Component @Provides (specifications = MyInterface.class) @Stereotype @Target(TYPE) public @interface MyComponent { }
- build and install "Stereotype" in local maven repo
- using maven, create another bundle (say "Stereotype-bundle") containing a class that uses the stereotype:
@MyComponent public class ComponentByStereotype extends ComponentBase implements AnotherInterface
- configure BND of "Stereotype-bundle" like this (the bundle does not need to export or include any package):
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> <Bundle-Version>${project.version}</Bundle-Version> <Import-Package>test.ipojo.stereotype,*</Import-Package> <Private-Package></Private-Package> <Export-Package></Export-Package>
- make sure "Stereotype-bundle" has "Stereotype" in it's maven dependencies
- configure maven-ipojo-plugin in "Stereotype-bundle"
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-ipojo-plugin</artifactId> <version>1.12.0</version> <executions> <execution> <goals> <goal>ipojo-bundle</goal> </goals> </execution> </executions> </plugin>
- Try to build 'Stereotype-bundle'
Expected result: The 'Stereotype-bundle' will be build and @MyComponent annotation will be processed.
Actual result: The @MyComponent annotation is NOT processed. The following is displayed in console:
[WARNING] Class test.ipojo.bundle.ComponentByStereotype has not been marked as a component type (no @Component, @Handler, ...). It will be ignored by the iPOJO manipulator.