This is my little playground application. It demonstrates the following features.
- What do we have out of the box?
- very quick project start-up (via start.spring.io)
- ready to use parent POMs
- Maven plug-in produces runnable fat JAR
- embedded servlet engine
- serving static content
- supporting webjars for Bootstrap, jQuery & Co
- REST
- Configuration
- ready to use configuration chain (see Setting Properties below)
- type save config
- Metrics & Monitoring via Actuator
- including an own health indicator
- including an own metric (counter)
- app info (Git commit id)
- JPA, using
- an opinionated in-memory DB H2 setup
- auto generated repositories
- transactions
- Testing
- Caching
- Task scheduling
- Application events
- Async feature
- JMS messaging
This demo uses Project Lombok data classes to reduce boiler plate code.
$ mvn package
$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar
$ open 'http://localhost:8080'
A Spring Boot application comes with a ready to use configuration chain. So you may set properties via Java system properties.
$ java -Dserver.port=8081 -Dspring.cache.type=none -jar target/springdemo-0.0.1-SNAPSHOT.jar
... or via OS Environment.
$ export SERVER_PORT=8081
$ export SPRING_CACHE_TYPE=none
$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar
... or via application properties
$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar --server.port=8081 --spring.cache.type=none
... and of course via config file...