M2E “Plugin execution not covered by lifecycle configuration”

If you want to use the maven plugin M2E for eclipse, one usually gets an error message of the following kind:

  Plugin execution not covered by lifecycle configuration:org.scala-tools:maven-scala-plugin:2.15.2:compile (execution: default, phase: compile)

A fast resoluton is to add a plugin execution filter to section org.eclipse.m2e. Thus my error was removed by adding the following lines to my pom.xml:

<plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.scala-tools</groupId>
                        <artifactId>maven-scala-plugin</artifactId>
                        <versionRange>[1.0.0,)</versionRange>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore />
                    </action>
                </pluginExecution>
            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
</plugin>

One has to add one plugin execution filter for every error message.

Advertisements