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

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.

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

--
Regards,
Igor


On 2014-09-10, 3:56, Barrie Treloar wrote:


On 10 September 2014 16:15, Anton Tanasenko <atg.sleepless@xxxxxxxxx
<mailto:atg.sleepless@xxxxxxxxx>> wrote:

    Hi,
    As I understand, it is PDE that manages Plug-in dependencies and
    resolves workspace plugins, m2e basically only provides ways for
    tycho to configure the project correctly.
    You should expect the following nature in .project (in addition to
    java and m2e ones): <nature>org.eclipse.pde.PluginNature</nature>
    And following .classpath entry: <classpathentry kind="con"
    path="org.eclipse.pde.core.requiredPlugins"/>

    I haven't used felix bundle plugin, so it might be different from
    pure tycho based approach.


Thanks!
Your information was enough for me to find what I want via google
"maven-bundle-plugin m2e export bundle"

http://www.subshell.com/en/subshell/blog/Referencing-Maven-projects-from-Eclipse-plugins100.html
says to add this for m2e.

After adding this to the three bundle projects, and running Maven >
Update Project... on all of them and the RCP plugin, it works as expected.

|||<pluginManagement>|
|||<plugins>|
|||<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven |
|||build itself. -->|
|||<plugin>|
|||<groupId>org.eclipse.m2e</groupId>|
|||<artifactId>lifecycle-mapping</artifactId>|
|||<version>||1.0||.||0||</version>|
|||<configuration>|
|||<lifecycleMappingMetadata>|
|||<pluginExecutions>|
|||<pluginExecution>|
|||<pluginExecutionFilter>|
|||<groupId>org.apache.felix</groupId>|
|||<artifactId>maven-bundle-plugin</artifactId>|
|||<versionRange>[||1.0||.||0||,)</versionRange>|
|||<goals>|
|||<goal>manifest</goal>|
|||</goals>|
|||</pluginExecutionFilter>|
|||<action>|
|||<ignore></ignore>|
|||</action>|
|||</pluginExecution>|
|||</pluginExecutions>|
|||</lifecycleMappingMetadata>|
|||</configuration>|
|||</plugin>|
|||</plugins>|
|||</pluginManagement>|


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top