Category Archives: Resources and Tools

Links to interesting and helpful resources and tools

Solving the “Plugin execution not covered by lifecycle configuration” error in Eclipse

In a recent project, we were using the “xmlbeans-maven-plugin” for XML parsing with the “xmlbeans” goal configured on the plugin. However we get this annoying error message about lifecycle configuration on Eclipse “Plugin execution not covered by lifecycle configuration”!

To fix this, one solution consists of adding an ignore configuration to the pom.xml file that says to eclipse to ignore that goal on validation. I personally don’t like this solution because It pollutes the project pom.xml file with IDE specific stuff; and this solution is specific to the project, i.e. you could have this problem on other projects and you just want to fix once for all.

The other solution, that I personally advise, is to add that same configuration to the lifecycle mappings file of the m2e eclipse plugin:

    1. Open the Eclipse preferences window and open the maven preferences page:

2014-05-14_1135

  1. Open the mapping file with “Open workspace lifecycle mappings metadata” and add the following configuration (actually this configuration is the same as the one that is inserted into the project pom file with the help of the “quick-fix” menu):
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xmlbeans-maven-plugin</artifactId>
				<versionRange>2.3.3</versionRange>
				<goals>
					<goal>xmlbeans</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<ignore />
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>

This solution will fix the problem for all the projects in your workspace.

Context

  • Eclispe 3.7
  • Maven 2.x
  • m2e eclispe plugin