8

I would just like to setup a new GWT project in Eclipse and use Maven for dealing with all the jar jungle. I used gwt-maven-plugin with this instructions, but I can't get the project to work in Eclipse.

What I've actually done:

  • Created a maven project using the archetype gwt in command line.
  • Imported the projet in eclipse using import > existing maven project
  • While doing that I had errors saying:
gwt-maven-plugin:2.3.0-1:generateAsync - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:i18n - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:exploded - "No marketplace entries found to handle"

These errors don't go away even if I ignore them on the import.

How can I make these projects working? Is the problem that I skipped the "process-resources" setting? (There is no such setting in the latest version of m2e.)

Should I even use gwt-maven-plugin? Is there any other way of making a GWT project to use Maven? Or – is there any other way to fight with the jar jungle? What does GWT guys use?

I use Eclipse Indigo with m2e plugin 1.0.0 and Google suite plugin version 2.3.3.

jogojapan
  • 68,383
  • 11
  • 101
  • 131
hostnik
  • 2,583
  • 2
  • 17
  • 15

3 Answers3

7

Eventually I gave up Maven. As one other developer said "good ideas and bad code build communities faster" , I also remember my experience with Maven on all the projects: very promising on the beginning, but eventually you get to some problems and end up working more with configuring Maven than actually dealing with your own code.

I decided to manually copy needed .jar-s into /lib folder. I spent some time due to transitive dependencies, but LESS than dealing with Maven and now I have things under control. If sometime in the future working with libraries will become an overhead, I will consider using Ivy.

If someone wishes to stick with Maven, I lately found a very useful link by Google team: http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
They recommend using their sample projects and not gwt-maven-plugin archetypes (due to issues). I agree. They also provide needed pom lifecycle changes for Eclipse Indigo.

hostnik
  • 2,583
  • 2
  • 17
  • 15
  • Just curious, but roughly how many jars are you dealing with for that particular GWT project? I like the approach, but I feel like just managing API conflicts would become difficult without the aid of either Ivy or Maven. Plus, the little things that Ivy does (such as allowing you to tack on the jar version number to the name when it's brought into your lib directory) are nice. Just having a "lib" directory full of non-obviously-versioned jars makes me uneasy. – Jeff Evans Jul 24 '12 at 21:15
  • 1
    Maven shines when you know how to use it. – ramon_salla Jun 04 '13 at 12:55
  • 1
    Maven has a very odd learning curve. Simple things get done easily, but more complex things cannot be done until you understand exactly how it works, and what is being done in each step. The more I understand Maven, the more I like it. It is very frustrating to deal with without first understanding you'll have to dedicate some time to figuring it out. – aglassman Aug 13 '13 at 15:05
0

Disclaimer: The following guidelines are for Windows users. These steps are on the basis that, they have worked when tried by the replier and doesn't guarantee fulfledge working unless experimented by self and tried with proper prerequisites.

::Creating a simple gwt project using archetype::

Following are few commands that can be used to create a simple gwt project "Web Starter Application":

  1. mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0
  2. mvn -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 org.apache.maven.plugins:maven-archetype-plugin:generate
  3. mvn -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 -Dmodule={module name} org.apache.maven.plugins:maven-archetype-plugin:generate

(The value of archetypeVersion can be 2.3.0 or any higher stable version.)

Few coordinates are required by maven to create the gwt project. They are as follows:

  1. groupId
  2. artifactId
  3. version
  4. module

The first command doesn't take any of the above coordinates hence, we need to supply them at the time it executes. Notice that the archetype goal is mentioned right at the beginning of the command. It is mandatory to give the archetype goal. The meanings of these coordinates can be found here. One of the best ways to start with understanding maven is this.

The second command doesn't consider the module name hence, you will be prompted to give it at the time the command executes.

The third command is equivalent to running it in batch mode where you just have to confirm the inputs for groupId, artifactId, version, module as mentioned in command itself.

Once any of these commands gives a BUILD SUCCESS result, then navigate to the just-now-created project folder from command line and execute the following command: mvn gwt:run

It should start the project in Development Mode so that you can Launch the Default Browser to run the project or Copy the URL to clipboard and navigate to it through any browser.

Good luck with the execution.

0

According to a recent post on the gwt-maven-plugin mailing list the Maven integration is not complete for Eclipse Indigo, since the M2Eclipse 1.0 release has brought about a large number of changes. The suggested workarounds from David Chandler, Google engineer, are:

You can run "mvn package" on the command line or right-click on the project > Maven > Run as > Maven build.

The plugin execution failures you're seeing can be resolved by adding lifecycle mapping metadata as in the sample POMs. They are only needed for Indigo. You should not get these errors in Helios or when running mvn package from the command line.

Community
  • 1
  • 1
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278
  • I've tried to use Helios. No exceptions, but I can't use Run as -> Web application. It has trouble with finding .gwt.xml. "Unable to find 'FaceOrg.gwt.xml' on your classpath;" but src/main/resources is on classpath. Is this gwt-maven-plugin stable enough for regular use? Currently I spent more time making it work than the time it would suppose to save me. – hostnik Sep 14 '11 at 09:10
  • Have you seen the instructions at http://mojo.codehaus.org/gwt-maven-plugin/eclipse/google_plugin.html ? – Robert Munteanu Sep 14 '11 at 12:19
  • Robert, I have. I tried to do many different things and at the end I always got into some problem. It seems that archetypes in gwt-maven-plugin are currently not working. – hostnik Sep 30 '11 at 07:42
  • @hostnik : I don't think there's a mention of the archetype in that page. I haven't used them myself so I can't tell if they work or not. But you should report it on the group or on the issue tracker ( http://jira.codehaus.org/browse/MGWT ) . – Robert Munteanu Sep 30 '11 at 08:19