1

I have created web application using Spring boot and gwt 2.6.0.

Changed location of generated files:

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>${gwt.plugin.version}</version>
            <executions>
                <execution>
                    <configuration>
                        <module>my.module</module>
                        <webappDirectory>src/main/resources/gwt-public/</webappDirectory>
                    </configuration>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

And if running my application standalone everything works correctly, because all the needed files are accessible.

But the question is - how to run GWT in development mode (from Intellij IDEA). I am trying to run it in -noserver mode, it launches but in browser there is nothing.

As I understand I need to specify war directory which is used by dev plugin, so it means I need to explicitly set packaging to war? I have no clear thoughts about it.

sandris
  • 1,478
  • 2
  • 18
  • 34

2 Answers2

1

you can compile a war, run the server and then run gwt debug, but after the browser opens change the url to the localhost:xxxx whatever spring is running, but leave the servercode=127.0.0.1 as is.

or you can use gwt:debug on maven plugin instaed of compile. looky here: http://mojo.codehaus.org/gwt-maven-plugin/debug-mojo.html

Zerkotin
  • 396
  • 3
  • 3
  • I was fighting with it few hours, and appears that it was very simple. Opening localhost/index.html?gwt.codesvr=127.0.0.1:9997 helped. Thanks! – sandris Jul 20 '14 at 13:55
0

I got this working by adding this to your gwt-maven-plugin configuration:

<superDevMode>false</superDevMode>

If you are going to change the URL as Zerkotin suggests, then I supplied this additional property:

<noServer>true</noServer>

to stop the mvn-gwt-plugin from starting up the embedded Jetty instance. But this did not allow me to recompile on the fly.

To get it working in super dev mode, I set this up in my gwt-maven-plugin config:

true true

Then I started up Spring Boot as normal (using java -jar myweb.jar). Then I started up maven gwt plugin (mvn gwt-debug), attached IntelliJ to the debugger (using remote), went to code server URL (NOT my app URL), set up those book marklets, then went to my app URL, and when I want to recompile, I just hit those bookmarklets.

Ben
  • 1
  • 1