felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konrad Windszus <konra...@gmx.de>
Subject Re: Future of maven-scr-plugin
Date Sun, 11 Oct 2015 15:09:49 GMT
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

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

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

> On 09 Oct 2015, at 21:33, Robert Munteanu <rombert@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
>>>> <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

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