Reputation: 289
So I tried to get the Maven Gwt archetype up and running. So some background info, I got Maven 3.0, and I have JDK 1.7 in Eclipse.
I ran the archetype, imported the project, and had a bunch of warnings and errors, I solved most of them but this one: GWT SDk servlet.jar was missing in WEB-INF/lib So I searched stack overflow, and used someones suggestion of using quick-fix to synchronize them. Now I get a warning saying that I have not J2SE1.5 installed.
Do I need J2SE1.5 to run my web app? Why is JDk 1.7 not enough?
Next, I get the warning
Classpath entry com.google.gwt.eclipse.core.GWT_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
Which I also have no clue why it is saying that.
But I am able to run the clean install gwt:run Maven goals without any problems.
I could suppress the warnings but my ADD would kill me, I'd rather understand the issues if I am going to just ignore them.
Upvotes: 1
Views: 905
Reputation: 64541
If you have a GWT_CONTAINER
entry in your build-path with a Maven project, then you're doing it wrong (gwt-maven-plugin
archetype most probably does it wrong, but I don't have the patience to fix all its warts and nobody else seems to bother; maybe we should simply get rid of it).
You should first install the Google Plugin for Eclipse (GPE), which works hand-in-hand with M2Eclipse (M2E) to autoconfigure the project when it detects it's a GWT project (makes use of the gwt-maven-plugin
IIRC).
Then make sure you don't have any .project
, .classpath
or .settings/
files/folders and import your Maven project in Eclipse. M2E and GPE should do everything for you. In the event that GPE doesn't add the GWT nature to your project, go check "Google Web Toolkit" in the project preferences, you'll see that GPE will have automatically selected the gwt-user
from your POM as the GWT SDK.
See http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven (which suggests avoiding the gwt-maven-plugin
archetype).
All in all, it's easier to simply start from scratch: add a dependency on gwt-user
and add the gwt-maven-plugin
, then do everything else with GPE wizards in Eclipse.
You might also find https://github.com/tbroyer/gwt-maven-archetypes helpful.
Upvotes: 1