Modular gwt with embedded Jetty
This derives from:
https://github.com/tbroyer/gwt-maven-archetypes
mvn gwt:codeserver -pl *-client -am
in another terminal window:
mvn jetty:run -pl *-server -am -Denv=dev
mvn package -P WAR
mvn exec:java -pl *-jettyMain -P call-main
mvn appengine:deploy -pl *-server -P gae-deploy
mvn package -pl *-client -am
mvn jetty:run -pl *-server -am
mvn gwt:codeserver -pl *-client -am
In Eclipse launch:
- mvn jetty:run -pl *-server -am -Denv=dev
with this in the VM arguments box under the JRE tab: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
- a remote java application at project *-server for localhost port 8000.
For hot restart in Eclipse select 'build automatically'.
Hot restart does not require a browser refresh.
mvn clean
mvn clean -pl *-server -am
mvn clean -pl *-server
In profile 'env-dev' there's no extraClasspath for sample-shared under jetty-maven-plugin as it causes multiple scanning warnings.
-
This is to remove for jetty:run profiles: sample-client & sample-jettyMain dependencies.
The latter requires 'WAR' profile to be not active by default. -
The gwt BOM artifactId in the root of artifact 'modular-webapp' is omitted, as it draws in unwanted dependencies in the WAR. It could be included in -client.
-
mvn package -pl *-client -am is required to to create resourceBase sample-client-1.0-SNAPSHOT
The alternative is a reactor build with sample-client as a dependency in -Denv=prod. Problem is then Jetty to expect a jetty_overlays directory, related to maven-war-plugin expecting to overlay gwt-app's content in the resulting WAR because -client is type war. -
mvn jetty:run -pl *-server -am :
If on 1st run: \sample-server\target\tmp directory fails to build, the 2nd attempt is ok.
The appengine-simple-jetty-main sample has unused declared embedded Jetty dependencies in sample-jettyMain:
jetty-util & jetty-annotations, they're removed here.
For the App Engine runtime to resolve com.example.Main: classpath is unspecified:
app.yaml: entrypoint: 'java -cp "*"
-pl,--projects
lists reactor projects to build instead of all projects.
-am,--also-make
to also build projects required by -pl projects
alternatively in an Eclipse launch select 'resolve workspace artifacts'.
No artifacts need to be installed but this might be advisable as it involves additional chaecks.