bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
532 stars 305 forks source link

[m2e integration] eclipse Photon does not run bnd-maven-plugin #2895

Closed babymotte closed 5 years ago

babymotte commented 5 years ago

Bndtools version: 4.1.0 and 4.0.0 (I haven't tested older versions) bnd-maven-plugin version: 4.1.0 and 4.0.0 eclipse version: 4.10.0 (+ any other version of Photon as far as I can tell) Java version: Oracle JDK 8, Oracle JDK 10, OpenJDK 8, OpenJDK 10 (all Java version's I've tried so far)

When having maven bundles using the bnd-maven-plugin in a photon work space, eclipse will show this error:

"Plugin execution not covered by lifecycle configuration: biz.aQute.bnd:bnd-maven-plugin:4.1.0:bnd-process (execution: default, phase: process-classes)"

Consequentially incremental builds do not generate or update any bundle jars in the project's target folder.

I haven't seen this issue in eclipse Oxygen, but in Photon it has been reproducible on any machine and with any OS I have tried so far.

rotty3000 commented 5 years ago

I'm using m2e quite a lot these days, and I've been fixing some issues but I haven't experienced anything like these particular issues recently. I would ask to try the latest snapshot builds [1] of bnd 4.2.0 plugins to see if those solve your problems.

[1] https://bndtools.jfrog.io/bndtools/libs-snapshot/

babymotte commented 5 years ago

Thanks for the quick reply. I couldn't quite figure out how to install the latest snapshot from the link you posted. I did install today's snapshot from here [1] though and the issue is still there in that version.

[1] https://bndtools.jfrog.io/bndtools/update

rotty3000 commented 5 years ago

You simply need to do this in your pom:

    <pluginRepositories>
        <pluginRepository>
            <id>bnd-snapshots</id>
            <url>https://bndtools.jfrog.io/bndtools/libs-snapshot/</url>
            <layout>default</layout>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

and set all your bnd-* plugin versions to 4.2.0-SNAPSHOT

babymotte commented 5 years ago

Ok, I've played around a bit, here's what I found:

-

eclipse bndtools + bndtools-m2e Plugin 4.1.0 and bnd-maven-plugin 4.1.0:

eclipse Photon shows ONE error per project/pom:

Plugin execution not covered by lifecycle configuration: biz.aQute.bnd:bnd-maven-plugin:4.1.0:bnd-process (execution: default, phase: process-classes)

-

eclipse bndtools + bndtools-m2e Plugin 4.2.0-SNAPSHOT and bnd-maven-plugin 4.1.0:

eclipse Photon shows TWO errors per project/pom:

Conflicting lifecycle mapping (plugin execution "biz.aQute.bnd:bnd-maven-plugin:4.1.0:bnd-process (execution: default, phase: process-classes)"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.

Plugin execution not covered by lifecycle configuration: biz.aQute.bnd:bnd-maven-plugin:4.1.0:bnd-process (execution: default, phase: process-classes)

-

eclipse bndtools + bndtools-m2e Plugin 4.2.0-SNAPSHOT and bnd-maven-plugin 4.2.0-SNAPSHOT:

eclipse Photon shows TWO errors per project/pom:

Conflicting lifecycle mapping (plugin execution "biz.aQute.bnd:bnd-maven-plugin:4.2.0-SNAPSHOT:bnd-process (execution: default, phase: process-classes)"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.

Plugin execution not covered by lifecycle configuration: biz.aQute.bnd:bnd-maven-plugin:4.2.0-SNAPSHOT:bnd-process (execution: default, phase: process-classes)

-

eclipse bndtools + bndtools-m2e Plugin 4.1.0 and bnd-maven-plugin 4.2.0-SNAPSHOT:

everything works as expected

That was nonsense, see comment below.

-

Not quite sure what to make of this, anyway I hope it helps :D

babymotte commented 5 years ago

Ah, sorry, I mixed something up there. I actually have two eclipse Photon installations on my laptop and with the last test I accidentally started another one than with the previous three tests. The first one was eclipse 4.10.0 with m2e 1.10 and it shows error in ALL combinations of the eclipse and maven bnd plugins, the other one is eclipse 4.8.0 with m2e 1.9.0 and it doesn't show any errors in any of the combinations of eclipse and maven bnd plugins. I have a strong feeling that m2e 1.10.0 might be the culprit here. Which version of m2e are you using?

rotty3000 commented 5 years ago

I've got m2e 1.10.0 on Eclipses 2018-09 (4.9) Build id: I20180906-0745

I'll check to see if I have any previously ignored mappings that might be hiding these warnings from me.

rotty3000 commented 5 years ago

@gamerson do you know a way to check my eclipse workspaces to see if I've previously ignored some lifecycle mapping warnings?

gamerson commented 5 years ago

Eclipse m2e workspace level setting of those lifecycle mapping warnings are stored here

/.metadata/.plugins/org.eclipse.m2e.core On Wed, Jan 30, 2019 at 7:32 PM Raymond Augé wrote: > @gamerson do you know a way to check my > eclipse workspaces to see if I've previously ignored some lifecycle mapping > warnings? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > , or mute > the thread > > . > -- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com
rotty3000 commented 5 years ago

Great thanks Greg. I looked and can't find that I've ignored any lifecycle mappings. Also, when I create a new workspace and import the maven projects I get no warnings, here's an example workspace with only m2e projects that use bnd maven plugins

screenshot from 2019-01-30 20-56-17 screenshot from 2019-01-30 20-58-33 screenshot from 2019-01-30 20-57-09 screenshot from 2019-01-30 20-56-41

babymotte commented 5 years ago

Ok, that's weird. I'll put together a minimal example project that reproduces the issue on at least two independent systems and ping back here once I have it.

babymotte commented 5 years ago

It turns out with a fresh install of eclipse and a fresh workspace, I do not see this issue anymore when using Bndtools 4.2.0-SNAPSHOT eclipse and maven plugins, so I'm confident it won't be there anymore in the 4.2.0 release either.

I'll need to figure out why my existing eclipse installation still complains, but that's probably a local issue on my machine.

Thanks for your time and effort!

babymotte commented 5 years ago

Ok, one more update: it turns out that in a fresh Photon installation Bndtools 4.1.0 by itself also does not cause any issues, BUT as soon as I install the e(fx)clipse plugin (https://www.eclipse.org/efxclipse/index.html) from Photon's official p2 repo, the issue reappears. So apparently this is actually a compatibility issue between these two plugins, that is triggered by something that was changed between Photon and Oxygen (I've been using both plugins together in Oxygen for months without any issues).

I'm not sure where the best place to report this new issue would be. Should I create a new one here to raise awareness of the incompatibility?

rotty3000 commented 5 years ago

Yes please!

babymotte commented 5 years ago

Done https://github.com/bndtools/bnd/issues/2904