I recently wanted to do some source code analysis and found it difficult to find a good eclipse plugin. Luckily, it's now very easy to get your own SonarCube server running. Basically you only need a docker installation and a few simple steps. To start a SonarQube instance you run the following command:

docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube

Starting the SonarQube server will take several minutes. After it has started, you can generate a sonar report of your maven application with the followng command:

mvn sonar:sonar

If all goes well, you've just created your first report and can access it on localhost on port 9000! Because the local SonarQube server stores every analysis in an internal H2 database you can even see what has changed since the last run. Have fun!

[caption id="attachment_4547" align="aligncenter" width="584"]sonarcube-issues It seems that this project needs some attention...[/caption]

Please note that this setup is not recommended for production.  If you want to know more, checkout the SonarQube docker page.

shadow-left