del
del

Reputation: 6561

Using a GWT + Maven project in Eclipse

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?

Upvotes: 4

Views: 8504

Answers (2)

David
David

Reputation: 4285

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

Upvotes: 1

Eugene Ryzhikov
Eugene Ryzhikov

Reputation: 17359

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

Upvotes: 0

Related Questions