Hi Stefan and Konrad,

Your suggetions make sense, it is probably more worthwhile to focus on
getting the maven-bundle-plugin m2e-compatible. I was hoping to find a
quick fix in the maven-scr-plugin which would make it compatible with
newer m2e-tycho releases.

(some text snipped, more replies inline)

On Fri, 2015-12-04 at 23:36 +0000, Stefan Seifert wrote:
> 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:
> 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

Shipping our own lifecycle metadata should work given that we adopt the
m2e-friendly BuildContext API, so building in Eclipse would work.

What m2e-tycho does and I am not sure can be done with the regular
BuildContext API is replacing the 'bundle' goal with 'manifest' for
Eclipse executions. It does so for both performance and correctness
reasons ( build result would conflict with the regular JDT builder ).

Did you see any such problems when enabling plugin executions for the
maven-bundle-plugin in Eclipse?

Thanks,

Robert

> 
> 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-g
> lobal-parent/pom.xml#L185
> [2] https://github.com/wcm-io/wcm-io-tooling/blob/develop/maven/aem-g
> lobal-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