Tuesday, April 12, 2016

Help running DevMode with GWT 2.7 and no bookmarklets

Hi guys -

I've spent more than a day now on a quest to get DevMode running properly for GWT 2.7 with my multi-module GWT application. NOTE: I can run SDM completely fine using the bookmarklets, but I'm not sure that's the right way to do things now.

As background, I use the gwt-maven-plugin in my project.

It started (innocently enough) with an attempt to rectify the "[ERROR] Current binding properties are expanding to more than one permutation but per-file compilation requires that each compile operate on only one permutation." error I was seeing when attempting to just press the "Dev Mode On" button after changing code without first turning off dev mode. That was a bit of an annoyance that I thought I could get around.

After reading this post: http://stackoverflow.com/questions/27267704/gwt-super-dev-mode-recompile-doesnt-work, which led to this google group post: https://groups.google.com/forum/#!topic/google-web-toolkit-contributors/5lgtM77-1tM, it appears that directly running SDM and using the bookmarklets is not the proper way to do things in GWT 2.7+

My "project" was set up using @tbroyer's GWT multi-module archetype back on GWT 2.5. I build my project, deploy to a local Tomcat instance running at localhost:8080, and from there, I use the mvn:run-codeserver command to start the SDM server at localhost:9876. I navigate my browser to localhost:8080, then I can hit the Dev Mode On button and compile my applicable modules and I'm good to go with sourcemaps and debugging in the browser.

How do I get standard Dev Mode with no bookmarklets (which I know starts SDM by default and I think is the right 2.7 way to do things) to work in this configuration?

My pom includes:
<noserver>true</noserver>
<runTarget>http://localhost:8080</runTarget>

and I started the code server (I think) using
mvn gwt:debug

. This seems to start up okay and I see:

[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ xxx-gui-client ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 76 resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ xxx-gui-client ---

[INFO] Nothing to compile - all classes are up to date

[INFO] 

[INFO] <<< gwt-maven-plugin:2.7.0:debug (default-cli) < process-classes @ xxx-gui-client <<<


[INFO] --- gwt-maven-plugin:2.7.0:debug (default-cli) @ xxx-gui-client ---

[INFO] starting debugger on port 8000 in suspend mode

[INFO] create exploded Jetty webapp in /Users/xxx/Workspace/xxx/xxx/xxx-gui/client/target/xxx-client-5.7.0-SNAPSHOT

[INFO] Listening for transport dt_socket at address: 8000


Is Dev Mode not seeing my modules? When I run

mvn get:run-codeserver

I see similar output, but it finds all the classes it needs to compile:


[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ xxx-gui-client ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 76 resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ xxx-gui-client ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 1335 source files to /Users/xxx/Workspace/xxx/xxx/xxx-gui/client/target/xxx-client-5.7.0-SNAPSHOT/WEB-INF/classes

[INFO] 

[INFO] <<< gwt-maven-plugin:2.7.0:run-codeserver (default-cli) < process-classes @ xxx-gui-client <<<

[INFO] 

[INFO] --- gwt-maven-plugin:2.7.0:run-codeserver (default-cli) @ xxx-gui-client ---

[INFO] Turning off precompile in incremental mode.

[INFO] Super Dev Mode starting up


What's the link between that and my Tomcat instance? How do I "activate" dev mode in the browser? I see no red refresh button, there are no compilations happening in the code server terminal. What am I missing? Do I need an IDE to get a debugger going or do I need to tell Chrome to look at the code server? Would I be better served moving away from the older gwt-mvn-plugin and using tboyer's newer version?


I feel like this step:


Compile your application once using the ant build target. Ideally, you can use GWT's -war option to generate output files directly into your external server's static content folder. Otherwise, you'll need to copy the GWT output folder from war/<moduleName> to your external server's static content.

from this page: http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html could be the key, but I'm not understanding how that translates to using mvn gwt:debug. I've tried using the <webappDirectory> parameter and set it to where my local tomcat serves the GWT-generated files from, but nothing seems to get written there.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment