Maven,GWT和Eclipse项目 [英] Maven, GWT and Eclipse project

查看:215
本文介绍了Maven,GWT和Eclipse项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用最新的Maven,GWT和Eclipse设置新的Web项目。我试图用GWT Maven Plugin的可用原型生成它,命令如下:


mvn archetype:generate -DarchetypeGroupId = org.codehaus。 mojo
-DarchetypeArtifactId = gwt-maven-plugin -DarchetypeVersion = 2.4.0 -DarchetypeRepository = repo1.maven.org


运行mvn gwt:运行builds项目,应用开始,一切似乎都可以。当我试图将这个项目导入冥王星项目到Eclipse Indigo时,出现问题。我正在获得mvn警告


描述资源路径位置类型
maven-war-plugin目标inplace,爆炸 ,manifest被m2e pom.xml / contactmanager行忽略Maven Project Build Lifecycle Mapping Problem


和许多Java错误,如



  • 资源路径位置类型
    GreetingService无法解析为GwtTestContactManager.java / contactmanager / src / test / java / com / jeffmaury / contactmanager / client


  • 缺少异步接口GreetingServiceAsync



似乎有些事情发生了变化,最新的gwt,m2eclipse,eclipse靛蓝和mvn无法正常工作。



导入到Eclipse后,有没有办法修复这个基本的GWT项目?并从IDE运行生成的应用程序?




Btw我还遵循了许多教程(例如 http://riadiscuss.jeffmaury.com/2011/06/tutorial-maven-gwt-plugin-google.html )但没有成功。几乎所有的都被弃用了...




谢谢。

解决方案

你可以尝试在你的项目中添加像这样的东西:

 < build> 
< pluginManagement>
< plugins>
< plugin>
< groupId> org.eclipse.m2e< / groupId>
< artifactId>生命周期映射< / artifactId>
< version> 1.0.0< / version>
< configuration>
< lifecycleMappingMetadata>
< pluginExecutions>
< pluginExecution>
< pluginExecutionFilter>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-war-plugin< / artifactId>
< versionRange> [2.0,)< / versionRange>
< goals>
< goal> inplace< / goal>
< goal> expanding< / goal>
< goal>清单< / goal>
< / goals>
< / pluginExecutionFilter>
< action>
< ignore />
< / action>
< / pluginExecution>
< / pluginExecutions>
< / lifecycleMappingMetadata>
< / configuration>
< / plugin>
< / plugins>
< / pluginManagement>
< / build>


I'm trying to setup new web project using newest Maven, GWT and Eclipse. I'm trying to generate it with available archetype from GWT Maven Plugin with command:

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.4.0 -DarchetypeRepository=repo1.maven.org

Running mvn gwt:run builds project, appication starts and everything seems to be ok. The problem appears when I'm trying to import this project as "Maven Project" into Eclipse Indigo. I'm getting mvn warning

Description Resource Path Location Type maven-war-plugin goals "inplace", "exploded", "manifest" are ignored by m2e pom.xml /contactmanager line 93 Maven Project Build Lifecycle Mapping Problem

and many Java errors like

  • Resource Path Location Type GreetingService cannot be resolved to a type GwtTestContactManager.java /contactmanager/src/test/java/com/jeffmaury/contactmanager/client

  • Missing asynchronous interface GreetingServiceAsync

It seems like something has changed and the newest gwt, m2eclipse, eclipse indigo and mvn can't work together properly.

Is there any way to fix this basic GWT project after importing into Eclipse? And to run this generated application from IDE?

Btw I've followed also many tutorials (e.g. http://riadiscuss.jeffmaury.com/2011/06/tutorial-maven-gwt-plugin-google.html) but without success. Almost all of them were deprecated...


Thanks.

解决方案

Can you try adding something like this in your projects pom:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-war-plugin</artifactId>
                                    <versionRange>[2.0,)</versionRange>
                                    <goals>
                                        <goal>inplace</goal>
                                        <goal>exploded</goal>
                                        <goal>manifest</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

这篇关于Maven,GWT和Eclipse项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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