20
votes

I have jaxws-maven-plugin in parent pom.xml in the pluginManagement tag and I am referring to this plugin in the child pom.

mvn clean install is running fine. But, eclipse is complaining that "Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:jaxws-maven-plugin:1.12:wsimport (execution: FirstWsdl, phase: generate-sources)".

Could you suggest how to avoid this error in eclipse?

parent pom

<pluginManagement>
    <plugins>
    ...
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>1.12</version>
        <executions>
            <execution>
                <id>FirstWsdl</id>
                <goals>
                    <goal>wsimport</goal>
                </goals>
                <phase>generate-sources</phase>
                <configuration>
                    <wsdlLocation>location/file.wsdl</wsdlLocation>
                    <wsdlFiles>
                        <wsdlFile>file.wsdl</wsdlFile>
                    </wsdlFiles>
                    <packageName>com.xxx.package</packageName>
                </configuration>
            </execution>

        </executions>
        <configuration>
            <sourceDestDir>${basedir}/generated</sourceDestDir>
            <verbose>true</verbose>
            <extension>true</extension>
            <keep>true</keep>
            <vmArgs>
                <vmArg .../>
            </vmArgs>
        </configuration>

    </plugin>
...
   </plugins>
</pluginManagement>   

child pom

<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
    </plugin>
</plugins>

I looked at this question and reply How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds, but, should I use pluginManagement both in parent and child pom to avoid this error?

4

4 Answers

25
votes

This should be:

  • documented in the wiki page "M2E plugin execution not covered":

    Project build lifecycle mapping can be configured in a project's pom.xml, contributed by Eclipse plugins, or defaulted to the commonly used Maven plugins shipped with m2e.
    We call these "lifecycle mapping metadata sources".
    m2e will create error marker like below for all plugin executions that do not have lifecycle mapping in any of the mapping metadata sources.

  • illustrated in "How to solve “Plugin execution not covered by lifecycle configuration” for Spring Data Maven Builds" (that you reference).

    • either by adding the lifecycleMappingMetadata in the parent pom.
    • or by enclosing the plugins with the <pluginManagement> tag (in both pom).

That thread adds more details to your specific error message:

when taking a look in the Eclipse-UI in the project properties under “Maven” -> “Lifecyle Mapping” (having checked the “Show lifecycle phases” checkbox and disabled “Show ignored executions”), I see the following content.
To my understanding this file shows the mapping between the Eclipse build lifecycle (runtime/incremental) and its bound Maven plugins.
Currently, it does not contain the “jax-ws” plugin respectively its goal “wsimport”.

The problem is that you have the jax-ws plugin declared in the pluginManagement section.
To get a binding to a phase it should be in build/plugins.
Performing a Maven build from CLI wouldn't work either, so I suspect that you're not doing the standard "mvn install"?

To get the Maven execution from within Eclispe to work you don't have to do anything.
But if you want to have incremental/runtime support in the IDE you should get the proper m2e connector. If you look at the pom in the POM editor in Eclipse, the plugin execution should be marked with a red error X. Hover on that and you should get an option to find one ("Discover new m2e connectors").

27
votes

If you can't find connectior you can turn off this error in eclipse because as a documentation says:

To get the Maven execution from within Eclispe to work you don't have to do anything.

so go to Eclipse: Preferences -> Maven -> Error/Warnings and change Error to Warning in option: Plugin execution not converted by lifecycle configuration

0
votes

https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html is the original page which explains it all. Defining it in the parent should be enough for its children.

-1
votes

Go to pom.xml and right click > Add Dependency> enter the Group Id and Artifact Id click ok. This will resolve the "Plugin execution not covered by lifecycle" issue.