[ 
https://issues.apache.org/jira/browse/FELIX-4009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194918#comment-15194918
 ] 

Stefan Seifert commented on FELIX-4009:
---------------------------------------

yes, i'm still working on this. (btw., carsten you forget one file from the 
patch, the file 
{{tools/maven-bundle-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml}})
 - i can contribute it again with the next patch.

currently i'm debugging an issue on a project with a lot of old-style felix SCR 
annotations where the eclipse builder does get mixed up with resource file 
change detection and starts a big number of compilations/maven builds where one 
would be sufficient.

regarding the open points mentioned by konrad:

bq. 1. it conflicts with m2e-tycho 
(http://dev.eclipse.org/mhonarc/lists/m2e-users/msg05444.html)
i'm still not shure when this m2e-tycho plugin gets installed. konrad described 
when this is happening here: 
https://github.com/apache/felix/pull/57#issuecomment-195718014
i've never used this catalog, but perhaps others are affected. the answer in 
http://dev.eclipse.org/mhonarc/lists/m2e-users/msg05444.html is:
"Anders Hammar: As I understand the plugin has priority. The connector will be 
ignored.".
so there is no conflict?

bq. 2. it does only cover goal manifest but not bundle
this is by intention! the goal is not to do a complete maven build in eclipse. 
if you compare it with a non-osgi project: eclipse does not build the jar file, 
it does only the compilation. so we do not need to build the bundle here. the 
goal is to produce only the artefact that are required by other tools in 
eclipse. my main usecase are the SCR metadata required for unit tests based on 
osgi-mock. the bundle manifest file would be usefull to in unit test context.
the package imports/exports are normally not import in unit test context, but 
we should avoid to produce only partially valid manifest files so we should 
generate them as well.
but the bundle goal should not be executed in eclipse.

bq. 3. it might not work for larger projects as triggering the manifest 
calculation for every change might just consumer just too much resources (see 
also 
https://github.com/tesla/m2eclipse-tycho/commit/85cd048ffcd47020992bdec2cd44f1a4945173bf
 and 
https://github.com/bndtools/bnd/commit/9a899b4eb50b6684b9a75759697066e84e82d16d.
i had some ideas in 
https://github.com/apache/felix/pull/57#issuecomment-195712456 how to generate 
SCR metadata only when required, but as konrad and robert point out this is not 
so easy as it seems.
so my first option would be to make it configurable in the POM whether SCR 
metadata and manifest should be generated on incremental builds or not. in my 
tests it was not that slow. so each project can decide between comfort and 
performance. i will include such an option in an updated patch.

> maven bundle plugin should be integrated directly with eclipse
> --------------------------------------------------------------
>
>                 Key: FELIX-4009
>                 URL: https://issues.apache.org/jira/browse/FELIX-4009
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.3.7
>            Reporter: Andrei Pozolotin
>            Assignee: Carsten Ziegeler
>              Labels: m2e
>             Fix For: maven-bundle-plugin-3.0.2
>
>
> Stuart:
> 1) currently, to integrate maven-bundle-plugin into m2e, one must  use tycho 
> configurator
> https://github.com/sonatype/m2eclipse-tycho
> which adds needles complexity, and makes few strange assumptions
> https://github.com/sonatype/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/src/org/sonatype/tycho/m2e/internal/OsgiBundleProjectConfigurator.java#L74
> which no one it seems is there to care to correct
> https://github.com/sonatype/m2eclipse-tycho/pull/8
> 2) instead, I suggest maven-bundle-plugin to provide direct integration with 
> eclipse via
> http://wiki.eclipse.org/M2E_compatible_maven_plugins#BuildContext
> which I would expect to be more customizable / flexible for the end user.
> I recently made similar switch with my DS plugin, and life got easier :-)
> https://github.com/carrot-garden/carrot-maven/tree/master/carrot-maven-scr-plugin
> thanks.
> Andrei.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to