Milen Dyankov created FELIX-4668:
------------------------------------
Summary: Can not use @Stereotype annotated annotation from another
bundle (unless its package is included or re-exported)
Key: FELIX-4668
URL: https://issues.apache.org/jira/browse/FELIX-4668
Project: Felix
Issue Type: Bug
Components: iPOJO
Environment: maven-ipojo-plugin 1.12.0
Reporter: Milen Dyankov
Priority: Minor
Here are the steps:
# create a bundle (say "Stereotype") that exports package
{{test.ipojo.stereotype}} containing
## the {{MyInterface}} interface
## the {{MyComponent}} annotation:
{code}
@Component
@Provides (specifications = MyInterface.class)
@Stereotype
@Target(TYPE)
public @interface MyComponent {
}
{code}
# build and install "Stereotype" in local maven repo
# using maven, create another bundle (say "Stereotype-bundle") containing a
class that uses the stereotype:
{code}
@MyComponent
public class ComponentByStereotype extends ComponentBase implements
AnotherInterface
{code}
# configure BND of "Stereotype-bundle" like this (the bundle does not need to
export or include any package):
{code:xml}
<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>
{code}
# make sure "Stereotype-bundle" has "Stereotype" in it's maven dependencies
# configure {{maven-ipojo-plugin}} in "Stereotype-bundle"
{code:xml}
<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>
{code}
# 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:
{code}
[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.
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)