[ 
https://issues.apache.org/jira/browse/FELIX-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14175458#comment-14175458
 ] 

Guillaume Sauthier commented on FELIX-4668:
-------------------------------------------

The stereotype support was initially designed with the ipojo-bnd-plugin in mind.
As the maven-bundle-plugin (that has to be configured to use the ipojo plugin) 
is aware of all the dependencies of your project, it is possible to load 
"external" annotations.

Using any other manipulator frontend mandates you to include your stereotypes 
classes inside of your bundle.

> 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
>              Labels: ipojo-manipulator, maven
>         Attachments: stereotype-test.zip
>
>
> 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)

Reply via email to