felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milen Dyankov <milendyan...@gmail.com>
Subject Re: iPojo @Stereotype annotated annotation from separate bundle
Date Mon, 15 Sep 2014 13:04:44 GMT
OK,  found the problem. It's due to how <Export-Package> of
the maven-bundle-plugin is configured.

Here is an example:
- I have stereotype maven project where I define a @Stereotype as
*test.ipojo.stereotype*.MyComponent
- The bundle maven project where I try to use the stereotype has its
classes in the package *test.ipojo.bundle*

When I have this in the bundle maven project :

<Export-Package>test.ipojo.bundle*;version=${project.version}</Export-Package>

it does not work! What I see in the console is:

[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.

However changing this to:

<Export-Package>*test.ipojo.stereotype**
,test.ipojo.bundle*;version=${project.version}</Export-Package>

works just fine.

While I now know how to make it work, I'm still confused why do I need to
export the stereotype package?



On Mon, Sep 15, 2014 at 11:24 AM, Milen Dyankov <milendyankov@gmail.com>
wrote:

> Thanks for explaining how it works Clement!
> I am indeed using maven and I tried to add the jar as a maven-ipojo-
> plugin dependency but it still does not seem to work.
> I'll play a bit with it and if it still does not work I'll try to extract
> and provide a simple example so you can eventually tell me what I'm doing
> wrong.
>
> Best,
> Milen
>
>
> On Sat, Sep 13, 2014 at 9:01 AM, Clement Escoffier <
> clement.escoffier@gmail.com> wrote:
>
>> Hi,
>>
>> Stereotypes are analyzed at build time, not at runtime. So they are
>> packaged in regular jars. To work as expected, the stereotype need to be
>> available from the ‘manipulator’ engine, in other words: be in the same
>> class path.
>>
>> So, if you are using Maven, you can do as follows:
>>
>> <plugin>
>>     <groupId>org.apache.felix</groupId>
>>     <artifactId>maven-ipojo-plugin</artifactId>
>>     <executions>
>>         <execution>
>>             <goals>
>>                 <goal>ipojo-bundle</goal>
>>             </goals>
>>         </execution>
>>     </executions>
>>     <dependencies>
>>         <dependency>
>>             <groupId>your.groupId</groupId>
>>             <artifactId>your.sterotype.artifactId</artifactId>
>>             <version>your.version</version>
>>         </dependency>
>>     </dependencies>
>> </plugin>
>>
>> Cheers,
>>
>> Clement
>>
>>
>>
>> On 13 septembre 2014 at 02:06:25, Milen Dyankov (milendyankov@gmail.com)
>> wrote:
>>
>> Hi,
>>
>> Is the usage of a @Stereotype annotated annotation from another bundle
>> supported? It doesn't seem to work even though the package is properly
>> exported and imported.
>>
>> The docs only say:
>>
>> If the stereotyped annotation is directly in the manipulated module, no
>> > problems: any front-end will work as expected.
>> > If not, the different manipulator's front-end have variable support for
>> > the stereotype feature.
>>
>>
>> This is not very clear to me and to be honest I'm no sure what a
>> "manipulator's front-end" is.
>>
>> Regards,
>> Milen
>>
>>
>>
>> --
>> http://about.me/milen
>>
>
>
>
> --
> http://about.me/milen
>



-- 
http://about.me/milen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message