Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

GWT Development workflow

169 views
Skip to first unread message

tbb

unread,
Jan 22, 2025, 7:30:13 PMJan 22
to GWT Users
Hi all,

I've been a long-time user of GWT, and I'm working on a fairly large project based on GWT 2.8.2.

Our dev workflow is using GWT's DevMode with the built-in Jetty server. We're about to upgrade our stack for newer GWT and Java versions. As mentioned in this group many times, DevMode is no longer recommended and doesn't work for our setup in newer GWT/JDK combinations. So I want/need to use a webserver + codeserver. I've now got Tomcat/Cargo with Codeserver working, but I'm not 100% on the typical dev cycle.

As I understand it, it would be:
- Build the (exploded) WAR, which includes a GWT compile (1 permutation for dev). I've read that Codeserver only works with a compiled GWT app. 
- Run Cargo/Tomcat 
- Run GWT Codeserver
- In the browser, click on bookmarklet to compile
- Refresh the page for GWT compile

It's more involved than previously just starting gwt:debug, so maybe I'm missing some best practice?

What's your dev workflow?

Cheers,
Thomas

tekkyru

unread,
Jan 22, 2025, 10:38:42 PMJan 22
to GWT Users
Hi Thomas

In my development cycle I had to get rid of Jetty and GWT Eclipse plugin (I use Eclipse) because of "JAR hell" caused by different tools running in same classloader (Eclipse GWT plugin, GWT code server, my Spring web app, Jetty)
To do that I have created a Gradle task (I use Gradle) running GWT dev server targeting an Eclipse WTP plugin folder (for Tomcat in my case). It took time to configure separate classpaths but finally it worked.
Then I run my web app the standard way as Eclipse/Tomcat server of my choice, run the Gradle GWT code server task (as Eclipse external tool) and use my webapp as if it was deployed on production - just open my index page and the GWT code server  (in SuperDev mode) does the magic of compiling on the fly.
GWT code server points to working folder of the Eclipse WTP plugin synched with my sources. This way I don't need to compile anything explicitly, I just shortly see the GWT compilation page before my main app page is loaded.

Craig Mitchell

unread,
Jan 23, 2025, 2:34:24 AMJan 23
to GWT Users
I switched to use Maven.

I created a template from  https://github.com/NaluKit/gwt-maven-springboot-archetype  and merged that framework to my project.

tbb

unread,
Jan 23, 2025, 6:39:14 PMJan 23
to GWT Users
Thanks @tekkyru and and @Craig. I'm using maven, but with the old mojo plugin, not the tbroyer one. I'll check out what the tbroyer one does. My plan is to move to that one anyway.

Jens

unread,
Jan 25, 2025, 10:54:42 AMJan 25
to GWT Users
You should definitely move to the tbroyer maven plugin if you use maven.

In general the CodeServer class has a parameter named "-launcherDir". It should point to your exploded war directory or, if not, the content of configured folder should be included in the war file you build for development. CodeServer produces a special *.nocache.js file which automatically triggers recompilation in the browser whenever you reload the page.

Other than that the workflow is pretty much what you have described:
- Launch SuperDevMode
- Launch a servlet container, e.g. Jetty, Tomcat, whatever (local installation, docker container, ...)
- Use an exploded war directory or a package war file which includes the output of SuperDevMode
- If you make code changes you have to either redeploy your app, reload the page to trigger a GWT recompile or do both.

Personally I use Gradle to launch SuperDevMode and to build the development war file. Then I use exactly the same stack as in production via docker images to deploy and serve the war file. This minimizes differences between development and production and thus minimizes surprises. 

-- J.

tbb

unread,
Jan 31, 2025, 1:31:02 AMJan 31
to GWT Users
Danke Jens. Just got around to answering it now.

For context, I'm planning to migrate the whole app to the new tbroyer mvn plugin and was looking for some quick interim solution. I've tested the tbroyer mvn plugin in the past and need to familiarise myself with it again.

By "SuperDevMode" do you mean the CodeServer, don't you?

Cheers,
Thomas 

Jens

unread,
Feb 1, 2025, 2:59:00 PMFeb 1
to GWT Users
By "SuperDevMode" do you mean the CodeServer, don't you?

Yes. GWT has a deprecated classic DevMode which is launched by a java class named DevMode. The successor is SuperDevMode which is launched by a java class named CodeServer. So people say SuperDevMode (SDM) or CodeServer and both mean the same.

-- J.
Reply all
Reply to author
Forward
0 new messages