user3813234
user3813234

Reputation: 1682

gwt dev mode: code changes dont show up

I'm just starting with GWT 2.7.0.

I launched the sample application that comes with it using mvn gwt:run on the command line (I created the project using the mojo gwt maven-plugin). It works fine.

However, when I change the code (in my case in the HTML file), the changes won't show up in the browser after recompile and refresh.

I don't get any error messages.

What do I need to change?

Upvotes: 0

Views: 501

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

Because src/main/resources can be filtered and/or relocated, you need to run mvn process-resources each time you make a change there (this is generally done automatically by your IDE though).

Because GWT DevMode runs out of an exploded WAR folder and writes to it, and its a bad practice to write into source folders with Maven, src/main/webapp is copied when you run mvn gwt:run (to get something into the target folder where DevMode will run) but won't be monitored for changes afterwards. That means you need to either make changes into the webappDirectory too, to see them in DevMode without restarting it, or run something like mvn war:exploded.

It goes without saying that changes to server-side code must be followed by a mvn process-classes (assuming you changed the output directory to the WEB-INF/classes of your target folder) or mvn war:exploded.

mvn war:exploded will also take care of your server-side dependencies, so you need to run it each time you change your POM, then in the DevMode window you can restart the webapp to get the changes to the server-side code without the need restart DevMode entirely.

In other words, only changes to client-side code (and resources) in src/main/java will be seen instantly with just a refresh of the page in your browser; every other change will require some action (some of them automated by your IDE if you use one).

Upvotes: 1

Related Questions