Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 3.25 KB

README.md

File metadata and controls

105 lines (67 loc) · 3.25 KB

gwt-maven-springboot-archetype

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.

How to use

Generate a project

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

where the available <artifactIds> is:

  • clean-modular-springboot-webapp
  • modular-springboot-webapp

This should use the latest release from the Central Repository.

📝 Maven 2.2 or later is required.

clean-modular-springboot-webapp

Generates a clean Spring Boot multi Maven module project without any example code. If you need a clean approach, this is the best way to start.

The generated project will use the following version:

  • Java 17
  • GWT 2.12.0
  • Spring Boot 3.3.5

modular-springboot-webapp

Generates a Spring Boot multi Maven module project with any example code. The example is similar to the one from the GWT project.

The generated project will use the following version:

  • Java 17
  • GWT 2.11.0
  • Spring Boot 3.2.5

Start the development mode

Change directory to your generated project and issue the following commands:

  1. In one terminal window: mvn gwt:codeserver -pl *-client -am
  2. In another terminal window: mvn spring-boot:run -pl *-server -am

📝 The -pl and -am are 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 outputs Started Application in xxx seconds.

Build a release

After you have generated your project from the above steps, you can create a release build and test it works.

Change directory to your generated project and issue the following commands:

  1. mvn clean package
  2. cd *-server/target
  3. java -jar myapp.war

📝 Replace myapp.war with the name of your war file.

Open http://localhost:8080 in a browser window to test your release build.

Contributing

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-archetype

Make your changes, and run:

mvn clean verify

This 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 install

Then use the mvn archetype:generate command from above, except for the -DarchetypeVersion argument which you'll replace with HEAD-SNAPSHOT.

To get in touch with the developer

Please visit use us at Nalu Gitter room.