23

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?

Community
  • 1
  • 1
would_like_to_be_anon
  • 1,639
  • 2
  • 29
  • 47

4 Answers4

37

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

Dawid D
  • 1,057
  • 13
  • 28
  • 3
    This is the easiest solution i've found, thank you.I think this answer should be marked as a correct answer. – krokodilko Nov 04 '17 at 10:10
  • It worked for the first time but again after exiting eclipse, the error in pom near comes again. I checked in setting and the setting is already in Warning. – Superman May 19 '22 at 05:08
  • @ShahFaisalKhan Thank you for your comment. Did you try to rebuild your project ? How to do it? Turn autobuild on in the Project Menu and then select "Clean..." in the Project Menu – Dawid D May 19 '22 at 18:48
  • @DawidD No, build automatically is selected by default. So, far I haven't got any solution for this and it's really annoying. – Superman May 27 '22 at 13:02
  • @ShahFaisalKhan Sorry I meant "off" – Dawid D May 27 '22 at 13:09
  • @DawidD nope, it didn't work. The only way it is working is to change from Error to Warning in Preferences -> Maven. – Superman May 27 '22 at 18:07
  • @ShahFaisalKhan so ok just create a new question and fully describe the problem we will se what it might be and post the link here. – Dawid D May 28 '22 at 19:36
25

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").

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So, the only way seems to be adding lifecycle mapping metadata in parent pom to ignore the jax-ws plugin like in http://wiki.eclipse.org/M2E_plugin_execution_not_covered#ignore_plugin_goal. When I say Discover new m2e connectors, eclipse couldn't find one for the jax-ws plugin. However, when I am doing mvn clean install from the CLI, ws-import goal is running. – would_like_to_be_anon Oct 21 '13 at 17:11
  • @would_like_to_be_anon Yes, I agree, adding lifecycle mapping metadata seems to work. – VonC Oct 22 '13 at 05:13
0

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.

Theresa
  • 3,515
  • 10
  • 42
  • 47
Robert Scholte
  • 11,889
  • 2
  • 35
  • 44
-1

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.

dansek
  • 129
  • 1
  • 5