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.
If you have a
GWT_CONTAINERentry in your build-path with a Maven project, then you’re doing it wrong (gwt-maven-pluginarchetype 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-pluginIIRC).Then make sure you don’t have any
.project,.classpathor.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 thegwt-userfrom your POM as the GWT SDK.See http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven (which suggests avoiding the
gwt-maven-pluginarchetype).All in all, it’s easier to simply start from scratch: add a dependency on
gwt-userand add thegwt-maven-plugin, then do everything else with GPE wizards in Eclipse.You might also find https://github.com/tbroyer/gwt-maven-archetypes helpful.