A classic Java Web application project mixing backend Java classes and frontend static resources. This projects uses the W20 framework to provide a sample UI, but you can easily change it.

The result is a single-JAR capsule embedding the Undertow Web server. It also includes the W20 bridge add-on which automatically manages the W20 frontend.

Creation

You need to have Apache Maven 3.1+ installed. To create a Java Web application project from scratch, execute the following command:

mvn org.seedstack:seedstack-maven-plugin:generate -Dtype=web

This will invoke the generate goal of the SeedStack maven plugin generate goal which will:

The process is interactive and will ask you a few questions about the project to be created.

Result

After execution, a single module project is created:

- myservice
    |- src
        |- main
        |   |- java
        |   |   |- org.myorg.myservice
        |   |       |- [application]    <-- application logic
        |   |       |- [domain]
        |   |       |   |- [model]      <-- domain model
        |   |       |   |- [services]   <-- domain services
        |   |       |- [infrastructure] <-- technical infrastructure
        |   |       |- rest             <-- REST resources and representations
        |   |- resources
        |       |- META-INF
        |           |- configuration    <-- main configuration
        |           |- [resources]      <-- frontend static resources
        |- test
            |- java
            |- resources
                |- META-INF
                    |- configuration    <-- test configuration

Note that the directory in brackets are not created by the archetype. They are the recommended locations if you need to add any business domain or static resources to your project. You can also choose to put the domain in a separate domain module.

Conversion to WAR

This project is designed to be run from the command-line with its embedded Web server. To convert it to a classic WAR, see this guide.

More resources