Hi Robert,
I just tried it out, but actually the OSGi-INF part of it is not properly 
updated within Eclipse.
By looking at the according m2e plugin 
(https://github.com/tesla/m2eclipse-tycho 
<https://github.com/tesla/m2eclipse-tycho>), I am not sure where the problem is 
exactly.

This is what I figured out so far:

There is a org.sonatype.tycho.m2e.felix.internal.MavenBundlePluginConfigurator 
configured in 
https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/plugin.xml
 
<https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/plugin.xml>
 
That returns a build participant in 
https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L87
 
<https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L87>.
That one executes org.apache.felix.bundleplugin.ManifestPlugin. Obviously the 
ManifestPlugin does not create the scr data unless exportScr is set to true 
(https://github.com/apache/felix/blob/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java#L80
 
<https://github.com/apache/felix/blob/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java#L80>).
 Unfortunately the exportScr is not set to true by m2eclipse-tycho (this is 
probably a bug in m2eclipse-tycho). 

Also the maven-bundle-plugin does not seem to support writing the metatype 
information (seems like a bug in the ManifestPlugin mojo of the 
maven-bundle-plugin).

Also I am not sure if the ManifestPlugin is called often enough by the 
MavenBundlePluginConfigurator, the conditions in 
https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L103
 
<https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/felix/internal/MavenBundlePluginConfigurator.java#L103>
 look wrong to me.
E.g. if someone just adds an OSGi component class carrying some annotations, 
this will not being picked up until the next full build. Maybe that is 
deliberate to increase the build performance, but that would mean not all 
changes lead to consistent Manifest/SCR/metatype informations.

Maybe someone else can confirm the observed behaviour, then I would create bug 
reports for both issues.
Konrad


> On 09 Oct 2015, at 21:33, Robert Munteanu <romb...@apache.org> wrote:
> 
> Hi Konrad,
> 
> 
>>> Am 09.10.15 um 18:14 schrieb Konrad Windszus:
>>>> I experimented a bit and using something like this in my pom.xml works 
>>>> pretty well.
>>>> 
>>>> <plugin>
>>>> <groupId>org.apache.felix</groupId>
>>>> <artifactId>maven-bundle-plugin</artifactId>
>>>> <version>3.0.0</version>
>>>> <extensions>true</extensions>
>>>> <configuration>
>>>>   <instructions>
>>>>     <!-- enable processing of default OSGI component annotations (since 
>>>> OSGi 5) -->
>>>>     <_dsannotations>*</_dsannotations>
>>>>     <!-- support inheritance on components -->
>>>>     <_dsannotations-inherit>true</_dsannotations-inherit>
>>>>     <!-- enable processing of default OSGI metatype annotations (since 
>>>> OSGi 6) -->
>>>>     <_metatypeannotations>*</_metatypeannotations>
>>>>     <!-- support parsing of maven-scr-plugin annotations through the 
>>>> felix.scr.bnd plugin -->
>>>>     
>>>> <_plugin>org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin;destdir=target/classes</_plugin>
>>>>   </instructions>
>>>> </configuration>
>>>> <dependencies>
>>>>  <!-- 
>>>> https://github.com/apache/felix/tree/trunk/tools/org.apache.felix.scr.bnd 
>>>> -->
>>>>  <dependency>
>>>>     <groupId>org.apache.felix</groupId>
>>>>     <artifactId>org.apache.felix.scr.bnd</artifactId>
>>>>     <version>1.4.0</version>
>>>>   </dependency>
>>>> </dependencies>
>>>> </plugin>
>>>> 
> 
> Out of curiosity, have you checked whether the m2e integration with
> Eclipse works? I'm interested in the generation of the manifest but
> also in the generation of the SCR descriptors.
> 
> Thanks,
> 
> Robert

Reply via email to