Groovy-based Maven WAR archetype using Spring Boot with the capability of generating static code analysis reports for Continuous Integration servers.
Handles app security and generates Restful web services for front-end stack to consume. Spring Boot serves as the backbone of this archetype.
Key Dependencies | Description |
---|---|
Swagger | RESTful web services documentation tool and viewer |
Apache Tomcat | Embedded JEE server (for local development) |
H2 | Embedded database (for local development) |
Spring | Dependency injection, handles plumbing code |
Spring Security | App security |
Spring Data JPA | JPA-based repositories |
Hibernate | ORM framework |
Spock | Groovy test cases |
Spring Boot CI | Static code analysis reports for Continuous Integration servers |
True single-page app from front-end-stack.
- Java version = 8.
- Maven version >= 3.3.x.
<dependency>
<groupId>com.github.choonchernlim</groupId>
<artifactId>choonchernlim-archetype-webapp</artifactId>
<version>2.0.0</version>
</dependency>
For example:
mvn archetype:generate
-DinteractiveMode=false
-DarchetypeGroupId=com.github.choonchernlim
-DarchetypeArtifactId=choonchernlim-archetype-webapp
-DarchetypeVersion=2.0.0
-DgroupId=com.github.choonchern.testProject
-DartifactId=testProject
-Dversion=1.0.0-SNAPSHOT
-
Run
mvn clean spring-boot:run -Drun.profiles=local
. -
Open
https://localhost:8443
in browser. -
Follow further instruction on that main page.
- This archetype is preconfigured with 3 Spring Profiles:-
middleware
(default) - For generated WAR deployed in Middleware servers using JNDI data source. This is the default profile ifspring.profiles.active
is not specified.local
- For local development using H2 data source.test
- For running test cases.
-
Run
mvn clean spring-boot:run -Drun.profiles=local
.- By default, this will perform
yarn build
to bundle the front-end JS files first before starting the server. - If there are no changes on front-end, you can speed it up by running
mvn clean spring-boot:run -Drun.profiles=local -Pskip-frontend-build
- By default, this will perform
-
Open
https://localhost:8443
in browser.
-
Change directory to
src/main/frontend
dir. -
Run
yarn start
. -
Open
https://localhost:8080
in browser.
- Run
mvn clean package
.
-
Create a "Freestyle project" job.
-
Under "Add build steps, select "Invoke top-level Maven targets".
- Goals:
-U clean test site
- Goals: