4
votes

I am having a lot of problems trying to create a simple GWT + Maven project that can be used from within Eclipse. Here's what I'm doing:

  1. Create a new gwt-maven-plugin project:

    mvn archetype:generate -q -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.0-rc2 -DgroupId=myGroupId -DartifactId=myArtifactId -Dversion=1.0 -Dmodule=myModule
  2. Open the project in Eclipse: File => Import... => Existing Maven Projects, then select the project I just created.

However, I get these errors:

No marketplace entries found to handle gwt-maven-plugin:2.5.0-rc2:generateAsync in Eclipse.  Please see Help for more information.
No marketplace entries found to handle gwt-maven-plugin:2.5.0-rc2:i18n in Eclipse.  Please see Help for more information.

I don't understand this error message. I've found a related question on SO, but adding the suggested snipped to my pom.xml didn't appear to do anything.

Can anyone shed some light?

2
Have you tried Project → Maven → Update project configuration… ? BTW, I don't recommend using the archetype. See code.google.com/p/google-web-toolkit/wiki/WorkingWithMavenThomas Broyer
Updating the project configuration didn't fix the problem. The tutorial you linked looks promising, I'll give it a go.del
Doesn't Eclipse propose you "quick fixes" for those errors? It should propose you to ignore them, for which it'll insert the appropriate configuration (similar to the one from Dvd Prd's answer) in the pluginManagement section of your POM.Thomas Broyer
@ThomasBroyer Thomas, the WorkingWithMaven guide suggests using starter pom configs, but all the poms use request factory. Is there a leaner pom that provides the bare necessities for an RPC GWT app?David Mann
github.com/tbroyer/gwt-maven-archetypes among many many others. I'm almost certain some samples use RPC though (validation maybe?)Thomas Broyer

2 Answers

1
votes

You should tell m2e to just ignore these warnings. Once you execute a goal the async & i18n goals are automatically executed its just a classic case of maven / eclipse not playing nice together.

Append the pluginManagement in your build section of the project (after the plugins element)

   <plugins>
          your  maven plugins here
    </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <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>i18n</goal>
                                            <goal>generateAsync</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

Finally add the folder target/generated-sources/gwt to the build path

0
votes

Instead of running from command line, install eclipse m2e (Maven Integration for Eclipse) plugin. This will make your life a lot easier.

UPDATE: Check this one out Maven GWT 2.0 and Eclipse