i'm currently experimenting as well with replacing maven-scr-plugin with 
maven-bundle-plugin & generate SCR metadata via bnd and 
org.apache.felix.scr.bnd bnd plugin as outlined by konrad.

on this way i've encountered the following issues:
1. FELIX-5108 allow to suppress log written by org.apache.felix.scr.bnd 
automatically to temp folder
2. FELIX-5116 fix dumping scr files to filesystem to support OSGi mocks
3. https://github.com/bndtools/bnd/issues/1183 to generate metatype files in 
v1.2 when v1.3 not required (to support AEM 6.1)
4. unlike maven-scr-plugin the maven-bundle-plugin generates the SCR metadata 
by default only in the package phase when the "bundle" goal is executed - this 
breaks the unit tests with OSGi mocks, they have to be generated before the 
tests are executed
5. in eclipse/m2e the scr metadata was not updated incrementally because the 
maven-bundle-plugin does not provide a m2e configuration unlike the 
maven-scr-plugin

i solved these problems by:
1.+2.: patch provided in tickets, used an intermediate/snapshot build with 
those included for testing
3.: used an intermediate/snapshot build from bndlib 1.3.0
4.: configured an additional execution for manifest goal which executes in 
process-classes phase and enable the "exportScr" feature to make sure they are 
not only written to the JAR file but to filesystem as well where they are 
expected by OSGi mocks
5.: added a custom m2e config to execute the manifest goal on incremental 
builds and configuration as well

you can see my experiments in this snapshot pom at [1] and [2]. the 
"intermediate" builds required to test this are located at [3].

i would favor as well shipping the maven-bundle-plugin with a sensible m2e 
default configuration, if we all agree what this should include precisely.

stefan

[1] 
https://github.com/wcm-io/wcm-io-tooling/blob/develop/maven/aem-global-parent/pom.xml#L185
[2] 
https://github.com/wcm-io/wcm-io-tooling/blob/develop/maven/aem-global-parent/pom.xml#L410
[3] http://wcm.io/maven/repositories/apache-intermediate-release/



>-----Original Message-----
>From: Konrad Windszus [mailto:[email protected]]
>Sent: Friday, December 04, 2015 7:02 PM
>To: [email protected]
>Subject: Re: How do the maven-scr-plugin and maven-bundle-plugin cooperate?
>
>Hi Robert,
>is this really worth the effort?
>I guess we should now focus only on the maven-bundle-plugin as that can
>even parse scr-compatible annotations now (compare with http://www.mail-
>archive.com/[email protected]/msg38291.html).
>That way we don’t need to further examine the communications across
>different plugins, but just fix m2eclipse-tycho to generate the manifest
>and the service descriptors whenever some class has been added/removed or
>just add the m2e extension to the maven-bundle-plugin itself (you suggested
>that already in http://www.mail-
>archive.com/[email protected]/msg38332.html).
>Is there any reason why you want m2eclipse-tycho to communicate with maven-
>scr-plugin instead of just relying on the internal bnd feature?
>Konrad

Reply via email to