Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] packaging=bundle and Import-Package dependencies not being added to m2e classpath



On 10 September 2014 21:16, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
m2e is supposed to offer installation of m2e-tycho extension
automatically. For new workspace projects this happens during project
import. For existing workspace projects, this is communicated via error
markers on pom.xml files. I am not sure why this didn't happen to do,
but I can have a look if you provide a small standalone example project
and exact steps to reproduce the problem.

Once m2e-tycho extension is installed, it is supposed to automatically
generate bundle manifests for workspace projects that use
maven-bundle-plugin and make such project visible to PDE as OSGi bundles.

That snippet of pom.xml configuration you pasted effectively disables
m2e-tycho extension, so I am not sure how it works for you. I recommend
removing this lifecycle mapping configuration.

Ok, I've removed those snippets, m2e > update project..., rebuilt everything - and it works.
I can see in the Java Build Path -> Libraries -> Plug-in Dependencies the three workspace projects I was expecting.

Now, I try exiting Eclipse, mvn clean on the command line, start Eclipse, refresh workspace, Eclipse Project > Clean all projects, and the errors appear again.
And only one workspace project has been configured, the other two are missing.


Couple of gotchas

By default, maven-bundle-plugin places generated bundle manifest under
target/classes/META-INF directory and this does not work reliably with
PDE. I usually reconfigure maven-bundle-plugin to generate manifest
under ${project.basedir}/META-INF when it runs inside m2e.

If you configure maven-bundle-plugin to replace -SNAPSHOT version
qualifier with timestamps, you need to suppress this behaviour inside
m2e workspace.

You can see relevant pom configuration used to build m2e itself in [1]

[1] http://git.eclipse.org/c/m2e/m2e-core.git/tree/m2e-maven-runtime/pom.xml?id=releases/1.5/1.5.0.20140606-0033#n107

Aha!

I've applied those changed to the felix bundle configuration.
Re-run the steps above to clean out my environment and it appears to be working as expected.

It has been a long while since I've scoured through the docs.
And I've had a quick look through both m2e and tycho docs and dont notice this wisdom.
I can't find anything in bugzilla for tycho about this as well (is that the right place to look?)

Should I raise an issue that the tycho/m2e integration should provide a warning when the maven-bundle-plugin hasn't been configured to use a PDE approriate manifestLocation?

Thanks for the help Igor.
I dont think I would have sorted that out without your intimite knowledge of both products.
 

Back to the top