Eclipse + Maven – Plugin execution not covered by lifecycle configuration

In this article, we will investigate various possibilities to suppress/resolve “Plugin execution not covered by lifecycle configuration” error

1. Plugin execution not covered by lifecycle configuration:

After configuring/installing Maven with Eclipse IDE, you may still get some issues –> one such issue is “Plugin execution not covered by lifecycle configuration

1_Eclipse-Maven_Plugin_Life_Cycle_not_Covered

2. Solution:

There are two ways available to fix this issue

  1. Ignore plugin
  2. Add this plugin to Lifecycle Mapping

2.1 Ignore Plugin:

Add below <pluginManagement> under <build> tag in the same pom.xml

For our example,

  • groupId –> org.jvnet.jax-ws-commons
  • artifactId –> jaxws-maven-plugin
  • versionRange –> [1.0.0,)
  • goal –> wsimport

Note: Above parameters changes according to the plugin, for which it throws this error

pom.xml (partial)

<pluginManagement>
	<plugins>
		<plugin>
			<groupId>org.eclipse.m2e</groupId>
			<artifactId>lifecycle-mapping</artifactId>
			<version>1.0.0</version>
			<configuration>
				<lifecycleMappingMetadata>
					<pluginExecutions>
						<pluginExecution>
							<pluginExecutionFilter>
								<groupId>org.jvnet.jax-ws-commons</groupId>
								<artifactId>jaxws-maven-plugin</artifactId>
								<versionRange>[1.0.0,)</versionRange>
								<goals>
									<goal>wsimport</goal>
								</goals>
							</pluginExecutionFilter>
							<action>
								<execute>
									<runOnIncremental>false</runOnIncremental>
								</execute>
							</action>
						</pluginExecution>
					</pluginExecutions>
				</lifecycleMappingMetadata>
			</configuration>
		</plugin>
	</plugins>
</pluginManagement>

2.2 Add this plugin to Lifecycle Mapping

Another way is to add this particular plugin to “Lifecycle Mapping” of Maven

  • Step 1: Open Eclipse –> Windows –> Preferences
  • Step 2: Go to Maven –> Lifecycle Mappings
    • And then Click “Open workspace lifecycle mappings metadata” –> which will open “lifecycle-mapping-metadata.xml” file in Eclipse editor
2_Eclipse-Maven_Plugin_Life_Cycle_not_Covered_maven_wizard
  • Step 3: Add below XML chunk to this file –> save the file
    • Finally click “Reload workspace lifecycle mappings metadata” to take effect of new changes in the working environment

pom.xml (partial)

<pluginExecution>
	<pluginExecutionFilter>
		<groupId>org.jvnet.jax-ws-commons</groupId>
		<artifactId>jaxws-maven-plugin</artifactId>
		<goals>
			<goal>wsimport</goal>
		</goals>
		<versionRange>[0.0,)</versionRange>
	</pluginExecutionFilter>
	<action>
		<ignore />
	</action>
</pluginExecution>

Again this is specific to “wsimport” goal and it may vary depending on the plugins configured for our business requirements

3. Useful Eclipse IDE shortcuts :

Related Articles:

References:

Happy Coding !!
Happy Learning !!

Eclipse + Maven - How to import Maven project with pom.xml ?
Eclipse + Maven - mvn eclipse:eclipse command