'Change behavior in sonar.java.binaries property

Disclaimer : I have tried to post this message on the users mailing list of Sonar.

We are using SonarQube 4.5.1 and encountered an issue this morning on some project using the property sonar.java.binaries.

We updated the version of the java plugin yesterday to 2.8 (we were using 2.5.1 before).

The error in the analysis is :

[ERROR] [20:43:58.997] Invalid value for sonar.java.binaries 
[ERROR] No files nor directories matching '/PATH_TO_JENKINS_WORKSPACES/sonar/PROJECT_NAME/release/PROJECT_JAR.jar' 

In the pom.xml, sonar.java.binaries property is valued with : ${basedir}/release/${project.artifactId}.jar

Variables changes is good on analysis and jar exists in the repository.

Here is my investigation :

  • When getting back to version 2.5.1, sonar analysis is OK
  • When using version 2.8, if sonar.java.binaries points straightly to a jar file, analysis is KO
  • When using version 2.8, if sonar.java.binaries points to a directory (in my case, ${basedir}/release/), the analysis is OK

Is the behavior of sonar.java.binaries, implemented in 2.8, wanted ? or this a regression ?

Thanks,

Frédéric



Solution 1:[1]

As your project is built using Maven, we recommend to analyze it using the SonarQube Maven Plugin. In that case you don't need to define the sonar.java.* properties

BTW : it would better to upgrade directly to SonarQube 4.5.4 and Java Plugin 3.3 to get all bug fixes / enhancements in particular new rules on bug detection coming with recent Java Plugin: http://nemo.sonarqube.org/coding_rules#languages=java|tags=bug|repositories=squid

Solution 2:[2]

As I understand from here you should use double slashes for sonar.java.binaries

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexandre - SonarSource
Solution 2 soninob