Cannot use jetty:run with Super DevMode

655 views
Skip to first unread message

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 12:13:43 AM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
I'm using Maven as a build tool in the project and I want to use Jetty as a web container for server-side stuff. However it's not possible to use jetty:run mojo with default configuration (at least it doesn't work for me).

There are several ways to run/deploy the server-side portion of the GWT application. Few of them are:
  1. Invoke jetty:war/jetty:run-exploded: this one will compile the whole application into target directory and will create war/exploded war. There are few issues with this approach:
    • every time the GWT client/shared code changes the full recompile has to be run. I know I can pass "-Dgwt.compiler.skip=true" to skip GWT compilation and later invoke recompile through Super DevMode bookmarklet.
    • to apply server-side changes the new full war/deploy has to be run
  2. Invoke gwt:run: this will run GWT DevMode. Removing the ?codeserver part from the URL will give expected outcome, however with minor distraction: "The module 'XXX' may need to be (re)compiled" every time you refresh/recompile the page through the "Dev Mode On" bookmarklet.
  3. Invoke jetty:run: The run goal runs on a webapp that does not have to be built into a WAR. Instead, Jetty deploys the webapp from its sources. This one I'm actually struggling with. In this case Jetty gets the WEB files from main/src/webapp and not from target/<project-name>-<project-version>, where GWT compiler has put JS files to support Super DevMode. So in this case clicking on the "Dev Mode On" will result in "Can't find any GWT Modules on this page".
The last options is most acceptable for rapid development allowing to quickly pick up server changes through Jetty "hot deploy" functionality and GWT client changes through the CodeServer. I would really appreciate any input on how to configure Jetty to look at previously compiled GWT stuff in target directory and being able to pick-up server-side changes without the need to compile/package/deploy.

Brandon Donnelson

unread,
Jul 8, 2014, 10:57:39 AM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
The sequence for running SDM goes like:

1. mvn install - first compile copies resources and compiles app to create a nocache.js for booting devmode
2. mvn gwt:codeserver - start the code server
3. mvn jetty:run -start a web server

If you have the web server for the resource, and the code server for the bookmarklets calls. If you have the linker in the project.gwt.xml it should work great. 

There is a faster boot sequence getting reviewed at the moment and we have a legacy patch at well which can override the current method to make it faster. 

Brandon



Have a good day,
Brandon Donnelson


--
You received this message because you are subscribed to the Google Groups "Codehaus Mojo gwt-maven-plugin Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-...@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-...@googlegroups.com.
Visit this group at http://groups.google.com/group/codehaus-mojo-gwt-maven-plugin-users.
For more options, visit https://groups.google.com/d/optout.

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 1:35:23 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
I did the first 2 steps. The 3d step is actually gives me "Can't find any GWT Modules on this page." whenever I press Dev Mode On. 

jetty:run uses the Web content from src/main/webapp, but the compile GWT stuff is located in target. I'm using the latest Jetty plugin "jetty-maven-plugin:9.2.1.v20140609".

Yarolsav
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-plugin-users+unsubscribe@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-maven-plugin...@googlegroups.com.

Brandon Donnelson

unread,
Jul 8, 2014, 1:59:44 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
The jetty web app path may need modification. Here's what I use. I use this to run web mode. By the way, we have a faster launch sequence on the way, that uses dev mode or will overrides devmode. launch sequence to boot code server, which is far faster, cuts some corners out. 

<!-- Server for running tests *TestInt.java -->

      <!-- 'mvn jetty:run' deploys and starts -->

      <!-- mvn jetty:start -->

      <!-- mvn jetty:stop -->

      <!-- mvn jetty:run -->

      <!-- mvn 'integration-test -Pintegration-test' runs integration tests -->

      <plugin>

        <groupId>org.mortbay.jetty</groupId>

        <artifactId>jetty-maven-plugin</artifactId>

        <version>8.1.9.v20130131</version>

        <configuration>

          <scanIntervalSeconds>10</scanIntervalSeconds>

          <stopPort>9966</stopPort>

          <stopKey>stop-jetty</stopKey>

          <webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>

          <!--<systemProperties> -->

          <!--<systemProperty> -->

          <!--<name>jetty.port</name> -->

          <!--<value>8888</value> -->

          <!--</systemProperty> -->

          <!--</systemProperties> -->

          <connectors>

            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">

              <port>8080</port>

              <maxIdleTime>60000</maxIdleTime>

              <!-- <host>192.168.10.6</host> -->

              <host>localhost</host>

            </connector>

          </connectors>

        </configuration>

        <executions>

          <execution>

            <id>start-jetty</id>

            <phase>pre-integration-test</phase>

            <goals>

              <goal>run</goal>

            </goals>

            <configuration>

              <daemon>true</daemon>

              <scanIntervalSeconds>0</scanIntervalSeconds>

            </configuration>

          </execution>

          <execution>

            <id>stop-jetty</id>

            <phase>post-integration-test</phase>

            <goals>

              <goal>stop</goal>

            </goals>

          </execution>

        </executions>

      </plugin>


Have a good day,
Brandon Donnelson


To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-...@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-...@googlegroups.com.

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 2:18:41 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Is it correct that the value of "${webappDirectory}" property is "${project.build.directory}/${project.build.finalName}"?

Yaroslav
To post to this group, send email to codehaus-mojo-gwt-maven-plugin-us...@googlegroups.com.

Brandon Donnelson

unread,
Jul 8, 2014, 2:42:36 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Just out of curiosity, does DevMode work fine? It should copy the files and build the compiled app inside the target/war folder. Can you run web mode or dev mode? If you can run one of those, than jetty should run fine. Then code server can be started up and it will use the compiled project directory that dev mode created, with nocache.js in it. 

Have a good day,
Brandon Donnelson


To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-...@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-...@googlegroups.com.

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 2:51:32 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Just out of curiosity, does DevMode work fine? It should copy the files and build the compiled app inside the target/war folder. 
The Dev mode works fine up to the point of Browser plugin integration. I'm using Linux and the plugin is not supported anymore. It does create target/war folder though
 
Can you run web mode or dev mode? If you can run one of those, than jetty should run fine. 
I can run DevMode, but if I use GWT DevMode (which also has Jetty) then I get "The module 'XXX' may need to be (re)compiled" every time I re-compile the app (which is annoying)
 
Then code server can be started up and it will use the compiled project directory that dev mode created, with nocache.js in it. 
The code server works perfectly. It's the web container always has config problems to make it serve GWT stuff. 

Yaroslav

Brandon Donnelson

unread,
Jul 8, 2014, 3:11:13 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Yeah, browser plugin support is no longer working, unless you use a older Browser version, like FF 26. 

Ok so DevMode works. To get rid of the error recompile error, web mode needs to be built, mvn install. This will build the project.nocache.js and put it in the target war directory, which is used with SDM. If web mode runs then the recompile dialog goes away. 

web container issues...
New or existing resources have to be copied to the target war directory, and this happens in the install lifecycle, although a plugin could be used to do this duty. The CodeServer -src argument can provide those resources for debugging in the browser. Add the resources directory to -src arg possibly, and any directory that isn't showing up in the source maps tree when inspecting. 








Have a good day,
Brandon Donnelson


To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-...@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-...@googlegroups.com.

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 3:25:32 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
That's the problem - mvn install will invoke full life-cycle build (even if you skip GWT compilation).

What I want to have is to be able to run Jetty with jetty:run (without the need to have maven package/install every time I change the server-side code), but jetty:run does not pick up the project.nocache.js from the target directory with default configuration.

Yaroslav

Brandon Donnelson

unread,
Jul 8, 2014, 3:36:31 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Ah gotcha. We've got a patch in for this for 2.7 and legacy backport on the way to fix this, the backport which stubs in a simple project.nocache.js file skipping a compile. -noprecompile can be used too. What I might do in the mean time to get around this is use a maven plugin that copies. Create a copy of the project.nocache.js and save it somewhere where it can be copied over using a maven plugin and trigger it with a goal during some lifecycle phase. 



Have a good day,
Brandon Donnelson


To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-mojo-gwt-maven-...@googlegroups.com.
To post to this group, send email to codehaus-mojo-gwt-...@googlegroups.com.

Yaroslav Sapozhnyk

unread,
Jul 8, 2014, 6:05:26 PM7/8/14
to codehaus-mojo-gwt-...@googlegroups.com
Thank you for the input. I'll try to look into running application as is with no packaging requirement and with GWT compilation output into target directory.

Something like having Standard GWT compiler output directory (target) and jetty:run with no packaging.

Yaroslav

Michael Wiles

unread,
Nov 7, 2014, 5:49:09 AM11/7/14
to codehaus-mojo-gwt-...@googlegroups.com
I'm very keen on this working...

How do you configure it to work on gwt 2.7?
Reply all
Reply to author
Forward
0 new messages