sonarqube + lombok = false positives

This case should be perfectly handled by SonarJava. Lombok annotations are taken into account at least since version 3.14 (SONARJAVA-1642). The issues you are getting are resulting from a misconfiguration of your Java project. No need to write any custom rules to handle this, this is natively supported by the analyzer. SonarJava reads bytecode to … Read more

Configure Sonar to exclude files from Maven pom.xml

Sonar exclusions (like other sonar properties) have to be added to the <properties> section of the POM file. Like so (example from excluding jOOQ autogenerated code from current project): <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <sonar.host.url>http://www.example.com/</sonar.host.url> <sonar.jdbc.url>jdbc:postgresql://www.example.com/sonar</sonar.jdbc.url> <sonar.jdbc.driver>org.postgresql.Driver</sonar.jdbc.driver> <sonar.jdbc.username>sonar</sonar.jdbc.username> <sonar.jdbc.password>sonar</sonar.jdbc.password> <sonar.exclusions>org/binarytherapy/generated/**/*, **/GuiceBindComposer.java</sonar.exclusions> <sonar.dynamic>reuseReports</sonar.dynamic> </properties>

integrating JaCoCo in sonar using Ant

The following is an ANT build that is configured to run a junit unit test and use jacoco for code coverage reporting. The results are uploaded to Sonar and finally ivy is used to download 3rd party jars and manage classpaths. Example ├── build.properties ├── build.xml ├── ivy.xml └── src ├── main │   └── java … Read more

New Integer vs valueOf

Integer.valueOf implements a cache for the values -128 to +127. See the last paragraph of the Java Language Specification, section 5.1.7, which explains the requirements for boxing (usually implemented in terms of the .valueOf methods). http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.7