Skip to content

Template project to demonstrate perfominging checkstyle format checks + static code analysis with sonarlint in java projects

License

Notifications You must be signed in to change notification settings

lh39/java-checkstyle-spotbugs-sonarqube-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-checkstyle-spotbugs-sonarqube-template

Template project to demonstrate the following code quality actions in java projects:

  • Checkstyle format checks
  • SpotBugs code analysis
  • SonarScanner / SonarQube static code analysis and code coverage

Configured to fail on findings (for Checkstyle + SpotBugs). For SonarScanner you will be able to see the results in the SonarQube dashboard.

Prerequisites

To perform SonarScanner actions, you must have running instance present locally. To start a local instance, run:

docker-compose up -d

Run checks

Run all checks

./mvnw clean verify

Run Checkstyle manually

./mvnw clean checkstyle:check

Run SpotBugs manually

./mvnw clean spotbugs:check

Run SonarScanner manually

./mvnw clean sonar:sonar
Browse http://localhost:9000 to see results of analysis.

Configurations

Checkstyle configuration

see: https://checkstyle.sourceforge.io/config.html

SpotBugs configuration

see: https://spotbugs.readthedocs.io/en/latest/maven.html

SonarScanner configuration

see: https://docs.sonarqube.org/latest/analyzing-source-code/scanners/sonarscanner-for-maven/
see: https://docs.sonarqube.org/latest/

IDE support

IntelliJ IDEA checkstyle plugin

see: https://plugins.jetbrains.com/plugin/1065-checkstyle-idea

IntelliJ SonarLint plugin

see: https://plugins.jetbrains.com/plugin/7973-sonarlint

IntelliJ IDEA SpotBugs plugin

see: https://plugins.jetbrains.com/plugin/14014-spotbugs

About

Template project to demonstrate perfominging checkstyle format checks + static code analysis with sonarlint in java projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages