Super quick-start for GWT (via GWT-Maven)
I wasn't aware you can run a Maven archetype using a remote repository the way Stephen Nimmo noted in his post about GWT-Maven. I should have known better, but the way I described it previously in the GWT-Maven documentation was to tell people to download the archetype artifact first, then install it, and THEN use it. That way is a lame, the *right* way is so much nicer ;).
With this setup you can create yourself a GWT project in one line (a bit of a long line, but hey, it is a single line), and then you can run it with one command. You don't need to download GWT yourself , you don't need to setup dependencies and classpaths, you don't have to write a Hello World project, all that jazz is handled for you. (You do need Java and Maven 2 of course, but those are given ;).)
Check it:
mvn archetype:create -DarchetypeGroupId=com.totsp.gwt -DarchetypeArtifactId=maven-googlewebtoolkit2-archetype -DarchetypeVersion=1.0.3 -DremoteRepositories=http://gwt-maven.googlecode.com/svn/trunk/mavenrepo -DartifactId=myGwtProject -DgroupId=com.myco

Then you have many GWT related facilities at your feet, via GWT-Maven. Run the GWTShell for example, and see your project update in real time while you change/edit code:
cd myGwtProject mvn gwt:gwt
. . . or build yourself a WAR for deployment in a servlet container (war ends up in ./target) . . .
mvn install
. . . or debug your project, also via the GWTShell (this starts a remote process with the debugger hook enabled, and you can then connect to it in your favorite IDE/debugger) . . .
mvn gwt:debug
. . . or test your project using BOTH it's standard JUnit/TestNG Surefire tests, and special GWTTestCase tests . . .
mvn test
If you need more info see the GWT-Maven docs, but you get the idea.








Comments
Very Nice
Glad to see we could help each other out. I used your blog for getting my remote debugger started.
Now, if we can get http://extjs.com/products/gxt/ to mavenize their offerings, it would be even easier.
Cheers!
porting existing projects to maven2
check out http://code.google.com/p/teraform-mvn
mavenization is really not too hard, surprisingly, with this first cut of script i developed to mavenize a very, very large netbeans project.
just about anything with ./lib, ./src, and so forth is a peice of cake. i produce the ./lib into a self-contained repo affectiuonately packaged 'deprecated'
cheers
This helps me so much ,
This helps me so much , Thanks,
simina,
New Error
Any idea what the deal is with this?
Required goal not found: gwt:debug in org.codehaus.mojo:gwt-maven-plugin:1.0
Worked perfectly yesterday...no changes.
That's the CODEHAUS maven
That's the CODEHAUS maven plugin in conflicting with the GWT-Maven one. If you have the codehaus repo in the path it will confuse, as both plugins use the "gwt" prefix.
Try using the fully qualified name for GWT-Maven "mvn com.totsp.gwt:maven-googlewebtoolkit2-plugin:gwt:debug" - it's annoying yes, but it's the only way I know if you also need Codehaus stuff.
http://code.google.com/p/gwt-maven/wiki/M2FAQ
Actually, it's worse than I
Actually, it's worse than I though, the codehaus plugin got released and org.codehaus is included in maven default lookups, so it picks up the codehaus one whether or not you also define a codehaus repo - will affect everyone now in other words, ouch.
We might change the prefix at GWT-Maven, I guess.
Extremely annoying
You can throw the definition for the 'gwt' prefix out of the
m2/org/codehaus/mojo/maven-metadata-central.xml file, but that only helps until it is updated. There may very well be an override mechanism in maven for situations like these, but I have not been able to find it. They should get rid of the default repositories or at least respect the order in which you mention them in your POM :(.
Very Helpful
I was struggling with trying to get Maven + GWT + Eclipse to work within the debugger. Your method is so much simpler.
Thanks for that!!
-Jeff