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.

zbyszek26104
  • 453
  • 1
  • 5
  • 15
  • 2
    See http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin/6475103#6475103 for you issue with M2Eclipse, and http://stackoverflow.com/questions/9703599/gwt-maven-project-flavors-webappcreator-or-gwt-maven-plugin-archetype-what-to/9705294#9705294 for an advice about how to create a GWT maven project (i.e. do not use that archetype); see also https://github.com/tbroyer/gwt-maven-archetypes for alternative archetypes. – Thomas Broyer May 28 '12 at 19:51

2 Answers2

3

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>
Sinisha Mihajlovski
  • 1,719
  • 1
  • 18
  • 32
2

maven and gwt are a real pain to get right.... I think the various plugins cause more problems than they solve...

I use mvn eclipse:eclipse to create the eclipse files after the project is created

Then to debug

mvn gwt:debug

which starts hosted mode outside of eclipse and listening at port 8000 for debugger connections...

and then debug by connecting to the remote application from eclipse....

Im not 100% sure if I created my projects the way you describe... I think so but its been a while

garrykelly
  • 21
  • 2
  • That's probably working but still I couldn't get it properly working. I've resigned and I'm not using Maven with GWT. But thanks for your reply. – zbyszek26104 Nov 10 '12 at 23:39