11

After upgrading to Eclipse Luna or to m2e 1.5.x and opening an existing workspace with Maven plugin projects, Eclipse complains that

Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-plugin-plugin ...
rec
  • 10,340
  • 3
  • 29
  • 43

4 Answers4

6

You need to tell m2eclipse how to treat the plugin execution.

If the message is for instance: Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor

Use following snippet:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-plugin-plugin</artifactId>
                                    <versionRange>[3.2,)</versionRange>
                                    <goals>
                                        <goal>descriptor</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Ondrej Burkert
  • 6,617
  • 2
  • 32
  • 27
5

Until version 1.4.x, the maven-plugin-plugin was covered by the default lifecycle mapping that ships with m2e.

Since version 1.5.x, the m2e default lifecycle mapping no longer covers the maven-plugin-plugin.

To get support for the maven-plugin-plugin with m2e version 1.5.x, install the new Maven Development Tools plugins.

You may notice this problem after upgrading to Eclipse Luna because it ships with 1.5.x by default.

rec
  • 10,340
  • 3
  • 29
  • 43
5

You can also configure eclipse to ignore or only warn for this issue.

enter image description here

Jason Huntley
  • 3,827
  • 2
  • 20
  • 27
1

For those who come here with newer Eclipse versions (2020-12 at time of this writing).

There's a M2Eclipse page Execution Not Covered with the following section:

Eclipse 4.2 Adds Default Mapping

If you are using Eclipse [...] and have troubles with mapping and won’t put mess into your pom.xml create a new file lifecycle-mapping-metadata.xml and configure it in WindowsPreferencesMavenLifecycle Mappings (don’t forget to press Reload workspace lifecycle mappings metadata after each change of this file!).

[Corrections and formatting by me.]

For the maven-plugin-plugin

  1. Add the following to lifecycle-mapping-metadata.xml:

         <pluginExecution>
             <pluginExecutionFilter>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-plugin-plugin</artifactId>
                 <versionRange>[0,)</versionRange>
                 <goals>
                     <goal>descriptor</goal>
                     <goal>helpmojo</goal>
                 </goals>
             </pluginExecutionFilter>
             <action>
                 <ignore />
             </action>
         </pluginExecution>
    
  2. Reload workspace lifecycle mappings metadata

  3. Right-click project → MavenUpdate Project... or Alt+F5

  4. See the Markers with Plugin execution not covered by lifecycle configuration: ... disappearing.

  5. Upvote this answer. :)

See also the bountied answer to How can I map Maven lifecycle phases not covered by the Eclipse m2e plugin?.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
  • In general, the problem with this approach is that you may want to set the action differently for different projects. E.g. in some projects you may want to execute a plugin, in others you may want to ignore it. Another problem is that your colleagues will have to repeat the process on their machines. If the settings are kept in the POM as suggested by a different answer here, all co-workers profit. – rec Jan 01 '21 at 01:06
  • @rec You're right. I don't have co-workers here at home, however. :) – Gerold Broser Jan 01 '21 at 01:24