Skip to content
GWT Spring Boot Archetype
Documentation / Quickstart

Quickstart

Generate a project, start the development mode and build a release. The generated project uses Java 17, GWT 2.13.1 and Spring Boot 4.1.0.

Generate a project

mvn archetype:generate -DarchetypeGroupId=io.github.nalukit.archetype -DarchetypeVersion=LATEST -DarchetypeArtifactId=<artifactId>

Replace <artifactId> with one of the two archetypes:

Archetype artifactIdGeneratesUse it when
clean-modular-springboot-webappA clean multi-module Spring Boot project without example codeYou know how things work and want to start your own project
modular-springboot-webappA multi-module Spring Boot project with example code, similar to the GWT sample projectYou want to see how the parts work together

Maven prompts for groupId, artifactId, version and package, and for the archetype properties module and module-short-name. See the archetype reference for their meaning.

Start the development mode

Change into the generated project directory and use two terminal windows.

Terminal 1: compile once and start the GWT code server.

mvn clean compile
mvn gwt:codeserver -pl *-client -am

Wait until the code server prints The code server is ready at http://127.0.0.1:9876/. After a mvn clean this step is necessary, because the launcherDir must exist inside the Spring Boot server before the server starts.

Terminal 2: start the Spring Boot server.

mvn spring-boot:run -pl *-server -am

When the server prints Started Application in xxx seconds, open http://localhost:8080/index.html in a browser.

-pl and -am are not strictly necessary. They tell Maven not to build the client module while you work on the server module, and the other way round.

Build a release

mvn clean package
cd *-server/target
java -jar <artifactId>.war

Replace <artifactId> with the name of the generated WAR file, which is the artifactId of your project. Open http://localhost:8080 to test the release build.

Go deeper