Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Provide lifecycle mapping metadata for the Eclipse plugin m2e #4

Open
ghusta opened this issue Oct 18, 2012 · 4 comments
Open

Provide lifecycle mapping metadata for the Eclipse plugin m2e #4

ghusta opened this issue Oct 18, 2012 · 4 comments

Comments

@ghusta
Copy link
Owner

ghusta commented Oct 18, 2012

Add lifecycle mapping metadata into the Maven plugin to help m2e configurator.
Works for m2e 1.1+

See M2E plugin execution not covered and lifecycle mapping metadata provided by maven plugin

ghusta added a commit that referenced this issue Oct 18, 2012
@ghusta
Copy link
Owner Author

ghusta commented Oct 18, 2012

See also wiki : Lifecycle mapping configuration priorities

@ghusta
Copy link
Owner Author

ghusta commented Oct 18, 2012

See also wiki : M2E compatible maven plugins

Overview

Starting with m2e 1.1, maven plugin developers can embed m2e lifecycle mapping metadata as META-INF/m2e/lifecycle-mapping-metadata.xml file included with main plugin artifact.
This file uses the same format as lifecycle-mapping-metadata.xml used by m2e project configurators and embedded in pom.xml file with some minor extensions to the format -- <pluginExecutionFilter/> elements are not required to provide plugin groupId, artifactId and versionRange because this information can be automatically derived from maven plugin already. Although groupId, artifactId and versionRange information is not required, it is still allowed by the format and maven plugin developers can still provide it if the choose so.

@ghusta
Copy link
Owner Author

ghusta commented Nov 5, 2012

Example : JAXB-2 Maven Plugin v1.5+

This plugin is compatible with m2e and integrates with the Eclipse build, providing incremental build support in the IDE. This requires m2e v1.1 or later.

So in jaxb2-maven-plugin-1.5.jar can be found in META-INF/m2e/lifecycle-mapping-metadata.xml :

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <goals>
          <goal>xjc</goal>
          <goal>testXjc</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <execute>
          <runOnIncremental>true</runOnIncremental>
          <runOnConfiguration>true</runOnConfiguration>
        </execute>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <goals>
          <goal>schemagen</goal>
          <goal>testSchemagen</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <execute>
          <runOnIncremental>true</runOnIncremental>
          <runOnConfiguration>false</runOnConfiguration>
        </execute>
      </action>
    </pluginExecution>
  </pluginExecutions>
</lifecycleMappingMetadata>

@ghusta
Copy link
Owner Author

ghusta commented Nov 6, 2012

Another example : Less CSS Maven Plugin

So in lesscss-maven-plugin-1.3.0.jar can be found in META-INF/m2e/lifecycle-mapping-metadata.xml :

<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <goals>
                    <goal>compile</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <execute>
                    <runOnIncremental>true</runOnIncremental>
                    <runOnConfiguration>false</runOnConfiguration>
                </execute>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant