I try to use Sonar on a Java 7 project (which relies on new syntactic features) and the PMD part and the Checkstyle part fail to parse those files.
The Findbugs part fails to read Java 7 class files.
This causes Sonar to consider only 10% of my classes.
Can there be a workaround for this?
EDIT: There is an issue for Java 7 compatibility.
Please vote for this issue, so it will be fixed soon.
Prerequisite. The only prerequisite for running SonarQube is to have Java (Oracle JRE 8 or OpenJDK 8) installed on your machine. Note: On Mac OS X it is highly recommended to install Oracle JDK 8 instead of the corresponding Oracle JRE since the JRE installation does not fully set up your Java environment properly.
analysis of helloworld java project projectname to the project name you created. open a command prompt, and go to project root folder. execute “sonar-runner” command to run the analysis. you would see the analysis run.
Sonar is a web based code quality analysis tool for Maven based Java projects. It covers a wide area of code quality check points which include: Architecture & Design, Complexity, Duplications, Coding Rules, Potential Bugs, Unit Test etc.
To set the appropriate version, you need to set sonar. java. source property to tell PMD which version of Java your source code complies to. Possible values: 1.4, 1.5 or 5, 1.6 or 6, 1.7 or 7.
You could try to make findbugs dev build manually and put it into sonar. Not the easiest way.
svn checkout http://findbugs.googlecode.com/svn/trunk/findbugs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With