This project contains a Maven archetype for modular GWT projects using Spring Boot. The repo is based on the implementation of Thomas Broyer's gwt-maven-archetypes.
If you are looking for the original archetype creator or would prefer another backend/implementation, please visit: gwt-maven-archetypes.
mvn archetype:generate -DarchetypeGroupId=com.github.nalukit.archetype -DarchetypeVersion=LATEST -DarchetypeArtifactId=<artifactId>where the available <artifactId> is:
-
clean-modular-springboot-webapp- Generates a clean Spring Boot multi Maven module project without any example code.
- This is the best way to start if you understand how things work and want to start your own project.
-
modular-springboot-webapp- Generates a Spring Boot multi Maven module project with example code.
- The example is similar to the one from the GWT project.
- This is the best way to start if you want to see how things are working.
The generated project will use the following versions:
- Java 17
- GWT 2.12.2
- Spring Boot 3.4.4
📝 Maven 2.2 or later is required.
Change directory to your generated project and issue the following commands:
- In one terminal window:
mvn gwt:codeserver -pl *-client -am - In another terminal window:
mvn spring-boot:run -pl *-server -am
📝 The
-pland-amare not strictly necessary, they just tell Maven not to build the client module when you're dealing with the server one, and vice versa.
Once both are server are running, enter http://localhost:8080 in a browser window.
📝 Both servers are running when the code server outputs
The code server is ready at http://127.0.0.1:9876/and the Spring Boot server outputsStarted Application in xxx seconds.
After you have generated your project from the above steps, you can create a release build and check if it works.
Change directory to your generated project and issue the following commands:
mvn clean packagecd *-server/targetjava -jar myapp.war
📝 Replace
myapp.warwith the name of your war file.
Open http://localhost:8080 in a browser window to test your release build.
If you want to hack on / contribute to the archetypes, you can:
git clone https://github.com/NaluKit/gwt-maven-springboot-archetype
cd gwt-maven-springboot-archetypeMake your changes, and run:
mvn clean verifyThis will generate sample apps that can be found in both the clean-modular-springboot-webapp and
modular-springboot-webapp directories, in the target/test-classes/projects/basic-webapp/project/basic-webapp
directory.
You can also install your modified version of the project locally:
mvn clean installThen use the mvn archetype:generate command from above, except for the -DarchetypeVersion argument which you'll
replace with HEAD-SNAPSHOT.
Please visit use us at Nalu Gitter room.