为什么我收到“不具有使用GWT的生命周期配置覆盖的”插件执行“错误? [英] Why am I receiving a "Plugin execution not covered by lifecycle configuration with GWT" error?

查看:81
本文介绍了为什么我收到“不具有使用GWT的生命周期配置覆盖的”插件执行“错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用STS,我从另一台机器导入了GWT项目。该项目使用m2eclipse。在构建项目时我收到这两个错误:

I'm using STS and I imported a GWT project from another machine. The project uses m2eclipse. I'm getting these two errors when building the project:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:gwt-maven-plugin:2.2.0:i18n (execution: default, phase: generate-sources)    pom.xml /contactsgwt    line 175
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-war-plugin:2.1.1:exploded (execution: default, phase: compile)  pom.xml /contactsgwt    line 198

怎么了?有没有进一步的配置需要做,所以 gwt maven插件的工作?

What's wrong? Is there any further configuration that needs to be done so the gwt maven plugin works?

pom.xml 导致错误的代码:

<!-- GWT Maven Plugin -->
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>2.2.0</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>test</goal>
                <goal>i18n</goal>
            </goals>
        </execution>
    </executions>
    <!-- Plugin configuration. There are many available options, see gwt-maven-plugin documentation at codehaus.org -->
    <configuration>
        <runTarget>Contacts.html</runTarget>
        <hostedWebapp>${webappDirectory}</hostedWebapp
        <i18nMessagesBundle>es.indra.gwt.contactsgwt.client.ContactsMessages</i18nMessagesBundle>
    </configuration>
</plugin>

<!-- Copy static web files before executing gwt:run -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>exploded</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <webappDirectory>${webappDirectory}</webappDirectory>
    </configuration>
</plugin>

<plugin>
    <groupId>org.maven.ide.eclipse</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>0.9.9-SNAPSHOT</version>
    <configuration>
        <mappingId>generic</mappingId>
        <configurators></configurators>
        <mojoExecutions>
            <mojoExecution runOnIncremental="true">org.codehaus.mojo:gwt-maven-plugin:2.2.0:i18n</mojoExecution>
            <mojoExecution runOnIncremental="true">org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources</mojoExecution>
            <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile</mojoExecution>
            <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-war-plugin:2.1.1:exploded</mojoExecution>
            <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-resources-plugin:2.4.1:testResources</mojoExecution>
        </mojoExecutions>
    </configuration>
</plugin>


推荐答案

如果您使用Eclipse Indigo(3.7)激活生命周期插件。
有关详细信息,请参阅此处

If you use Eclipse Indigo (3.7) you have to activate the lifecycle plugin. See here for more details.

只需将这个 pluginManagement 部分添加到您的 build 部分的 pom.xml 文件

Just add this pluginManagement section to your build section of your pom.xml file

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>gwt-maven-plugin</artifactId>
                                <versionRange>[2.4.0,)</versionRange>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>compile</goal>
                                    <goal>i18n</goal>
                                    <goal>generateAsync</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <execute />
                            </action>
                        </pluginExecution>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <versionRange>[2.1.1,)</versionRange>
                                <goals>
                                    <goal>exploded</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <execute />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

这篇关于为什么我收到“不具有使用GWT的生命周期配置覆盖的”插件执行“错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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