Eclipse中的pluginManagement在eclipse中的生命周期配置错误所涵盖的插件执行 [英] Plugin execution not covered by lifecycle configuration error in eclipse with pluginManagement in parent pom

查看:451
本文介绍了Eclipse中的pluginManagement在eclipse中的生命周期配置错误所涵盖的插件执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在pluginManagement标签的父pom.xml中有jaxws-maven-plugin,我在这个小插件中指的是这个插件。



mvn clean install正常运行。但是,eclipse正在抱怨
插件执行不被生命周期配置覆盖:org.codehaus.mojo:jaxws-maven-plugin:1.12:wsimport(execution:FirstWsdl,phase:generate-sources)。



你能建议如何在eclipse中避免这个错误?



父pom

 < pluginManagement> 
< plugins>
...
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> jaxws-maven-plugin< / artifactId>
< version> 1.12< / version>
<执行>
< 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

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

我看了这个问题并回复了如何解决未被生命周期配置覆盖的插件执行对于Spring Data Maven Builds ,但是,我应该在parent和child pom中使用pluginManagement来避免此错误吗?

解决方案

p>这应该是:





该线程为您的特定错误消息添加更多详细信息:



在Maven - >Lifecyle Mapping项目属性中查看Eclipse-UI(已选中显示生命周期阶段复选框并禁用显示忽略执行),我看到以下内容。

据了解,此文件显示了Eclipse构建生命周期(运行时/增量)与其绑定的Maven插件之间的映射。

目前,它不包含 jax-ws 插件分别其目标 wsimport


问题是您在 jax-ws > pluginManagement 部分。

要获得绑定到一个阶段,它应该在构建/插件。

从CLI执行Maven构建将不起作用,所以我怀疑你没有执行标准的mvn install?



要从Eclispe中获取Maven执行,您无需执行任何操作。

但是,如果要在IDE中增加/运行时支持,则应该获得正确的m2e连接器。如果您在Eclipse中的POM编辑器中查看pom,则插件执行应标记为红色错误X.悬停在此上,您应该可以找到一个选项(发现新的m2e连接器)。



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?

解决方案

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

这篇关于Eclipse中的pluginManagement在eclipse中的生命周期配置错误所涵盖的插件执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆