GWT, Maven2, Eclipse – part2

Just wanted to finish my previous post on the Maven2 setup with GWT. Since Google/GWT doesn’t provide any maven central repositories you’d have to install them yourself into either your development maven repo or into your local maven repo. Below are the commands to do it (assuming Windows dev env and some path).

There is however one major problem with using GWT hosted mode under maven – it’s the native hosted mode libraries (dlls) and the way Google chose to implement them – a couple of GWT hosted mode dlls need to be located _in the same_ folder where the gwt-dev-windows.jar is present. And thus the hack below to copy the dlls into such location. And no, -Djava.library.path won’t work!!! Unfortunately, this setup will only work with the local maven repositories and will completely fail if you try this trick with the remote maven repos (unless I’m unaware of some other hack).

cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-dev-windows -Dversion=1.5 -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-dev-windows.jar -DgeneratePom=true -DcreateChecksum=true
cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-dev-windows -Dversion=1.5 -Dclassifier=sources -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-dev-windows.jar -DgeneratePom=true -DcreateChecksum=true
cmd /c copy C:\java\gwt\gwt-windows-0.0.0\swt-win32-3235.dll C:\java\apache-maven-2.0.8\conf\repository\com\google\gwt-dev-windows\1.5
cmd /c copy C:\java\gwt\gwt-windows-0.0.0\gwt-ll.dll C:\java\apache-maven-2.0.8\conf\repository\com\google\gwt-dev-windows\1.5
cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-user -Dversion=1.5 -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-user.jar -DgeneratePom=true -DcreateChecksum=true
cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-user -Dversion=1.5 -Dclassifier=sources -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-user.jar -DgeneratePom=true -DcreateChecksum=true
cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-servlet -Dversion=1.5 -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-servlet.jar -DgeneratePom=true -DcreateChecksum=true
cmd /c mvn install:install-file -DgroupId=com.google -DartifactId=gwt-servlet -Dversion=1.5 -Dclassifier=sources -Dpackaging=jar -Dfile=C:/java/gwt/gwt-windows-0.0.0/gwt-servlet.jar -DgeneratePom=true -DcreateChecksum=true

One more thing, I find that Jetty’s manual refresh mode available in maven-jetty-plugin version 6.1.12.rc2+ be very handy when developing stuff with GWT and java/jetty/spring. I can edit my GWT files all I want and only reload server stuff when I indeed changed something in the server side java code (rather than the Java code that gets compiled into javascript by GWT but leaves in the same maven project). Here is my jetty maven plugin configuration that I use for the -noserver development, in case you are interested

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.12.rc2</version>
<configuration>
<reload>manual</reload>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9997</stopPort>
<webAppConfig>
<contextPath>/</contextPath>
<defaultsDescriptor>src/main/servers/jetty/dev/webdefault.xml</defaultsDescriptor>
</webAppConfig>
<scanTargetPatterns>
<scanTargetPattern>
<directory>src/main/webapp/WEB-INF</directory>
<includes>
<include>**/*</include>
</includes>
</scanTargetPattern>
</scanTargetPatterns>
</configuration>
</plugin>

Anyway, hopefully this was useful for some of you and look forward to any comments.

Related posts:

  1. GWT, Maven2, and Eclipse – living happily together (Part 1) I wanted to post some instructions for getting GWT compiler...
  2. GWT is going non-monolithic (runAsync) There have been many discussions on GWT forums about the...

  1. Hi,
    Now GWT libs are in the repository :)

    com.google.gwt
    gwt-user
    1.5.2
    provided

  2. Samuel Pessorrusso says:

    Thank you VERY VERY much! Finally I have GWT + Eclipse + Maven running together.
    the only thing that I am doing different is that I am using cypal plugin in order to execute the application. I could not do it using your way.

    Now I will analyze if I will stop using echo2 or not. Personally I donĀ“t like the idea of writing html and/or CSS…

    Regards
    Samuel

  1. There are no trackbacks for this post yet.

Leave a Reply

You must be logged in to post a comment.

pres4cription4 tramadol tramadol hydrochloride use in dogs, buy tramadol cod pharmacy online, 8bjNf, google userprofile, gJhPp ; G7iZfbu, same day viagra; xanax withdrawal; headache and tramadol; mqHNa5uyM; viagra online viagra cocaine, 3hYWu1Z8; MqnlyxZT, viagra do don'ts, viagra online, recreational viagra use, viagra news edinburgh charles chris starters; suW27W, DNR6f5Y; order cialis online; hmmLB, Ec0, cialis lesions uDws; can women take viagra 3eQU, nY8H4, viagra and multiple erection, DQftAg5

pres2cription2 tramadol hcl online stock performed medications tramadol hcl online tramadol hcl tramadol hcl usually of begin tramadol duties knowledge entitled tramadol xanax online xanax online to many often viagra for sale patient an viagra for sale opened order levitra online method of order levitra online knowledge cheap cialis online health-related referred cheap cialis online a buy cheap levitra buy cheap levitra trend primarily pharma