:test_tube: Play with SpringBoot 2&3, JWT, Querydsl, GraphQL, Docker, ELK, PostgreSQL, MariaDB, Redis, MongoDB, Flyway, Maven, Gradle, TestNG, JUnit5, JaCoCo, GreenMail, CI, Quality Gates, Prometheus, Gatling, etc.
Some experimentation with Spring Boot 3, JDK17, JUnit5, TestNG, SQL (HSQLDB, MariaDB, PostgreSQL), NoSQL (Redis, MongoDB), Docker, ELK stack, etc. It demonstrates usage of:
Spring Boot 3 migration
488454f
ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
issues when sending a large number (2000+) of HTTP requests with message bodyAbstractManagedException
javadoc for details.@BatchDataSource
annotation), and initialize two datasources via Flyway. See last commit of spring5-light-extra-datasource-for-springbatch branchSpyBean
(issue) on a Spring service used by GraphQL; can't load Flyway. That's why it's not merged into main branch yetdo
Bash script that helps you to launch some usefull commandsinfo
endpoint. See last commit of actuator-git-info branchhttp://localhost:8080/swagger-ui.html
. See commit 834852c (spring5-swagger branch)http://localhost:8080/swagger-ui.html
, JSON OpenAPI docs http://localhost:8080/v3/api-docs
, YAML OpenAPI docs http://localhost:8080/v3/api-docs.yaml
. See last commit of springdoc-openapi-v3 branch./do docker up
then check http://localhost:4000
. See last commit of spring5-light-glowroot-docker branch./do docker up
then check http://localhost:28080
. See last commit of spring-boot-admin branch (not merged into main branch yet)For fun and to show some skills :cat:
Jonathan Lermitage ([email protected])
Linkedin profile: jonathan-lermitage-092711142
First, install JDK17+ and Maven3+.
You can now use the ./do
Linux Bash script:
do help show this help message
do fixgit set executable flag on git index for required files
do fixexec set executable permission for required files (chmod +x on bash scripts)
do normgit call git add --update --renormalize
do conv generate a Dependency Convergence report in target/site/dependency-convergence.html
do oga check for deprecated groupId and artifactId couples
do owasp generate a OWASP dependencies vulnerabilities report in target/dependency-check-report.html
do t test using embedded HSQLDB
do td test using dockerized MariaDB and Redis (container is started and stopped by script)
do td-postgres test using dockerized PostgreSQL and Redis (container is started and stopped by script)
do ut run unit tests only, no integration tests
do tc run unit + integration tests and generate coverage data
do itc run integration tests only and generate coverage data
do gatling benchmark application via a Gatling container (run './do up' first to start application)
do sc compute and upload Sonar analysis to SonarCloud
do tsc similar to "do tc" then "do sc"
do sb scan with SpotBugs then show GUI
do b build without testing
do c clean
do p package application to manon.jar
do rd package and run application with dev-mariadb 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
do rmi stop Docker application, then remove its containers and images
do cdi clean up dangling Docker images
do dockerreset stop and remove all containers, remove all images and prune volumes
do docker build Docker image with Dockerfile to a Docker daemon
do dockerpull pull 3rd party Docker containers
do jib build Docker image with Jib to a Docker daemon
do jibtar build and save Docker image with Jib to a tarball
do up create and start containers via docker-compose
do stop stop containers via docker-compose
do upelk create and start ELK containers via docker-compose
do stopelk stop ELK containers via docker-compose
do upcerebro create and start Cerebro container via docker-compose
do stopcerebro stop Cerebro container via docker-compose
do maria connect to dockerized MariaDB business database by calling MySQL Client provided by container
do maria-batch connect to dockerized MariaDB Spring Batch database by calling MySQL Client provided by container
do mariah connect to dockerized MariaDB business database by calling host MySQL Client (mysql-client package must be installed)
do mariah-batch connect to dockerized MariaDB Spring Batch database by calling host MySQL Client (mysql-client package must be installed)
do e2e run some end-to-end (e2e) tests with Docker. Application image is built from a Dockerfile
do e2ejib run some end-to-end (e2e) tests with Docker. Application image is built with Jib
Nota: the Linux Bash script can chain parameters, e.g.: ./do cdi rmi w 3.6.0 c tc docker up
.
Nota: a Windows do.cmd
script exists, but it's limited to some basic features. Run do.cmd help
for details.
You may experience connection issues with many do
commands that use Maven Wrapper if you are behind a proxy. Maven Wrapper doesn't pick proxy configuration from Maven's settings, so you should give some proxy parameters to JVM. See this excellent Stack Overflow answer.
Some usefull git alias to put into your .gitconfig
file:
[alias]
# Show a pretty commit log
ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate --date=relative
# Checkout a merge request, example: git mr upstream 6
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
# Credit an author on the latest commit
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git diff --patch-with-stat"
MIT License. In other words, you can do what you want: this project is entirely OpenSource, Free and Gratis.