Some experimentation with Spring Boot 2, JDK9, NoSQL, etc. It demonstrates usage of:
- Maven and Gradle build tools
- Spring Boot 2 + Spring Framework 5 and migration from Spring Boot 1 + Spring Framework 4
- built with JDK8 and JDK9 on Travis CI (JDK10 and 11 asap)
- Spring Web, REST API
- Spring Security, to authenticate users via auth_basic, and fetch authentication data from MongoDB instead of default SQL database
- Spring Data to serve data from a MongoDB database
- Spring Batch to schedule and manage some tasks
- Spring Cache via Redis for application, and prefer an embedded cache provider during tests
- integration tests and (some) unit-test via TestNG, because TestNG is so much superior to JUnit4/5... (better keywords, dataproviders, old/mature and very stable API, easily configurable, test suites)
- tests work with an embedded MongoDB instance (for data) and HSQLDB (for Spring Batch internals only), that means you don't have to install any database to test project, simply run
mvnw test - integration with some free (for open-source) services like AppVeyor (Windows CI), Travis (Linux and MacOS CI), CodeCov (code coverage), SonarCloud (code quality)
- Maven and Gradle wrappers, and a
do.cmdscript that helps you to launch some usefull commands - code coverage thanks to JaCoCo Maven and Gradle plugin
- some AOP to capture performance of API endpoints
- Spring Actuator web endpoints configured
- Swagger UI to provide documentation about REST API endpoints
For fun and to show some skills 🐱
Jonathan Lermitage (jonathan.lermitage@gmail.com)
Your're Canadian or American and wanna hire an experienced French devops? Contact me! I'm okay to move.
Linkedin profile: jonathan-lermitage-092711142
- active
- spring5: main branch, based on Spring Framework 5, Spring Boot 2 and JDK8/9
- spring5-light: like spring5, without Spring Batch, Redis Cache, Swagger
- archived
- spring5-embedmongo: use embedded MongoDB during tests. See commits 37e1be5 and 161d321
- spring5-swagger: enable Swagger UI. Run application and check
http://localhost:8080/swagger-ui.html, authenticate withROOT/woot. See commit 429ae53 - spring5-redis: enable Redis cache, and prefer embedded cache during tests. See commits a911f6a, 7e26822 and ae6e0e6
- spring5-mvn-to-gradle: migration from Maven to Gradle. Stable and functional, but still needs some improvements
- spring4: previous active branch, based on Spring Framework 4, Spring Boot and JDK8
- spring4-redis-cache: enable caching based on Redis server. See commit 0f1eff7
- other branches may appear and disappear quickly, depending on experimentation results and motivation ;-)
To build and test, simply run mvnw test. To enable JaCoCo code coverage, activate the coverage profile: mvnw test -Pcoverage.
You can also use the do.cmd (Windows) or do.sh (Unix shell) script:
do help show this help message
do t test without code coverage
do tc test with code coverage
do sc compute and upload Sonar analysis to SonarCloud, needs two env vars:
- TK1_MANON_SONAR_ORGA SonarCloud organization, e.g. jonathanlermitage-github
- TK1_MANON_SONAR_LOGIN SonarCloud authentication token
do tsc similar to "do tc" then "do sc"
do b build without testing
do c clean
do p package application to manon.jar
do rd package and run application with dev profile
do w 3.5.2 set or upgrade Maven wrapper to 3.5.2
do cv check plugins and dependencies versions
do uv update plugins and dependencies versions
do dt show dependencies tree
MIT License. In other words, you can do what you want: this project is entirely OpenSource, Free and Gratis.