Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] m2e and AbstractMavenLifecycleParticipants



On 11-12-10 10:56 PM, Christopher Hunt wrote:
Hi Igor,

We're going to embark on following your recommendation re. developing
an Eclipse Plugin that provides an AbstractMavenDependencyResolver
implementation.


Can you please guide us and indicate how such a plugin should present
itself? For example do you see that this plugin becomes available
through the m2e discovery marketplace?


This is really up to you. m2e discovery catalog is instrumented with
additional metadata that allows semi-automatic installation of required
m2e extensions during maven project import. Otherwise it is exactly the
same as installing directly from your update site or from eclipse
marketplace.

I'd start with direct installation as it is the easiest to setup, then
decide if you want to publish your plugin to m2e discovery catalog
and/or eclipse marketplace.

Another thing that is puzzling us is whether our OSGi bundle exports
its own ILifecycleMapping2 instance. How does m2e handle such an
instance i.e. can there be more than one ILifecycleMapping2 in the
m2e environment? If there can only be one, must we replicate the
built-in AbstractMavenDependencyResolver implementation?


It is possible to associate lifecycle mapping implementation with
specific packaging type. You can use m2e-tycho [1] as an example.

There are tree pieces in this puzzle

1. org.eclipse.m2e.core.lifecycleMappings extension in plugin.xml. It
basically associates lifecycle mapping implementation with an id
2. lifecycle-mapping-metadata.xml, which associates your target
packaging type with your lifecycle mapping implementation id
3. org.eclipse.m2e.core.lifecycleMappingMetadataSource extension in
plugin.xml, which tells m2e to read lifecycle-mapping-metadata.xml

[1] https://github.com/sonatype/m2eclipse-tycho/tree/master/org.sonatype.tycho.m2e

Hope this helps.

--
Regards,
Igor


Back to the top