Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] m2e 0.13.0 not calling my lifecycle mapping or project configurator

Yes, lifecycleMappings and projectConfigurators are activated based on
lifecycle mapping metadata. The easiest way to provide this metadata is
via lifecycleMappingMetadataSource extension (see [1] or [2] for
examples), but it can be provided via pom.xml file as well.

Metadata-driven activation provides several benefits. It allows m2e to
create error markers for unknown plugin executions bound to project
build lifecycle. It allows m2e to offer installation of additional
required software. For example, when android project is imported, m2e
can offer installation of ADT integration, if it is not installed
already. It also allows more precise bundle activation, i.e. WTP
integration will not be enabled for APK projects.

On a related subject, recent changes in m2e 0.13 make lifecycleMappings
extensions necessary only in few advanced scenarios, when packaging type
requires radically different behaviour. The only real example we
currently have are Tycho projects, which require completely different
dependency resolution and classpath configuration logic. In all other
case we've seen so far default behaviour provided m2e is adequate and I
would like to understand if ADT integration really needs
lifecycleMappings and why.

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

--
Regards,
Igor

On 11-03-13 10:24 AM, Ricardo Gladwell wrote:
Hi Guys

Trying to upgrade my m2eclipse extension plugin,
m2eclipse-android-integration, to the new m2e 0.13.0 plugin. Looks
really good so far, nice work!

However, when switching to the new org.eclipse.m2e.* extension points,
my lifecycle mapping and project configurators are no longer being
called in my AbstractMavenProjectTestCase sub-class.

My plugin.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
     <extension point="org.eclipse.m2e.core.lifecycleMappings">
        <lifecycleMapping

class="com.googlecode.eclipse.m2e.android.AndroidDevelopmentToolsLifecycleMapping"
              id="com.googlecode.eclipse.m2e.android.lifecycleMapping"
              name="Android Development Tools Lifecycle Mapping">
        </lifecycleMapping>
     </extension>
     <extension
           point="org.eclipse.m2e.core.projectConfigurators">
        <configurator

class="com.googlecode.eclipse.m2e.android.AndroidDevelopmentToolsProjectConfigurator"

id="com.googlecode.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator"
              name="Android Development Tools Project Configurator"
              secondaryTo="org.eclipse.m2e.jdt.javaConfigurator">
        </configurator>
     </extension>
</plugin>

Is there something I'm doing wrong? Do I need both a configurator AND a
lifecycle mapping?

Please advise...



Back to the top