Continuous inspection of code quality with SonarQube - Java / Gradle / Docker project reference template
This repository demonstrates how to perform and configure continuous inspection of code quality with SonarQube for Java / Gradle projects.
- Local SonarQube server via docker compose
- Gradle SonarQube plugin configuration with custom coverage/issues exclusions
- Jacoco coverage reports
- Separated unit and integration tests.
- Spring Boot integration tests with WireMock
- Unit testing REST services clients via @RestClientTest
- Java 11
- Docker
- Start local SonarQube server
docker-compose -f ./docker/sonar.yml up -d
- Check if container is up and running by opening SonarQube dashboard, which should be available on http://localhost:9000/
- Run a SonarQube analysis
./gradlew clean sonarqube
- Once the analysis completes, it should be available on the Sonar dashboard.
- Check the code smells.
- Have a fun and play with the demo setup by fixing the code smells, adding more tests for better coverages or edit sonar-project.properties to tweak the analysis
For further reference, please consider the following sections:
Distributed under the MIT License. See LICENSE
for more information.