1

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.

4

2 回答 2

3

你可以尝试在你的项目 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>
于 2012-05-31T15:27:51.397 回答
2

maven 和 gwt 很难做到正确......我认为各种插件导致的问题多于解决的问题......

创建项目后,我使用 mvn eclipse:eclipse 创建 eclipse 文件

然后去调试

mvn gwt:调试

它在 Eclipse 之外启动托管模式并在端口 8000 上侦听调试器连接...

然后通过从 Eclipse 连接到远程应用程序进行调试....

我不是 100% 确定我是否按照您描述的方式创建了我的项目……我想是的,但已经有一段时间了

于 2012-05-31T15:05:29.873 回答