Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any current workarounds to use Sonar for Java 7 code?

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.

like image 891
java.is.for.desktop Avatar asked Aug 10 '11 21:08

java.is.for.desktop


People also ask

Does SonarQube run on Java 8?

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.

How do I analyze Java code in SonarQube?

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.

What is sonar used for in Java?

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.

How do I check my Java version in SonarQube?

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.


1 Answers

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
like image 112
Vladislav Bauer Avatar answered Sep 20 '22 08:09

Vladislav Bauer