Programming And Stuff, You Know The Thing…

How To Use The New TBroyer's GWT Maven Plugin To Create A WebApp

Posted at — Jan 29, 2019




Generate simple example WebApp project from archetype:

mvn archetype:generate \
    -DarchetypeGroupId=net.ltgt.gwt.archetypes \
    -DarchetypeVersion=LATEST \
    -DarchetypeArtifactId=modular-webapp \
    -DgroupId=my.example -DartifactId=example \
    -Dversion=1.0-SNAPSHOT -Dmodule-short-name=app

Change into the top level directoy of the newly generated maven project structure:

cd example

All of the remaining commands can be executed directly from that directory.

dev mode

Start developing:

mvn clean
mvn gwt:codeserver
mvn jetty:run -Denv=dev
# or: mvn tomcat7:run -Denv=dev

Now point your browser to http://localhost:8080 to check the current state of your project.

prod build

Create the final war:

mvn clean install

prod verify server

mvn tomcat7:run-war-only


mvn jetty:run-war

Again, go to http://localhost:8080 and verify the final webapp.