Discussion:
[sonar-user] Changing in sonar.java.binaries property behavior
Franck Arnulfo
2015-01-21 17:31:53 UTC
Permalink
Hello,



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,
--
Sent from Gmail Mobile
Andrew Reedick
2015-01-21 19:31:40 UTC
Permalink
I ran into the same problem today with Sonar 4.5.2 and a multi-module build where some of the modules have no java code. The solution that worked best for me was: http://jira.codehaus.org/browse/SONARJAVA-759, specifically http://jira.codehaus.org/browse/SONARJAVA-759?focusedCommentId=358880&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-358880

Which is to add the following the (sub) module’s pom’s properties section.

<properties>
<!--
Workaround for a problem introduced with
http://jira.codehaus.org/browse/SONARJAVA-759. If you leave
this property at its default value of "target/classes" the Java
plugin will fail with "Invalid value for sonar.binaries" for projects
without Java source code.
-->
<sonar.java.binaries>${basedir}</sonar.java.binaries>
</properties>

I personally had intermittent luck with the various sonar exclusions properties in solving the problem of codeless modules. http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus



From: Franck Arnulfo [mailto:***@gmail.com]
Sent: Wednesday, January 21, 2015 12:32 PM
To: ***@sonar.codehaus.org
Subject: [sonar-user] Changing in sonar.java.binaries property behavior


Hello,

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,
--
Sent from Gmail Mobile
Andrew Reedick
2015-01-21 19:45:17 UTC
Permalink
Bah. I misread the OP’s error message. Ignore my previous response, which addresses a different “invalid value for sonar.java.binaries” problem.


From: Andrew Reedick [mailto:***@incomm.com]
Sent: Wednesday, January 21, 2015 2:32 PM
To: ***@sonar.codehaus.org
Subject: RE: [sonar-user] Changing in sonar.java.binaries property behavior

I ran into the same problem today with Sonar 4.5.2 and a multi-module build where some of the modules have no java code. The solution that worked best for me was: http://jira.codehaus.org/browse/SONARJAVA-759, specifically http://jira.codehaus.org/browse/SONARJAVA-759?focusedCommentId=358880&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-358880

Which is to add the following the (sub) module’s pom’s properties section.

<properties>
<!--
Workaround for a problem introduced with
http://jira.codehaus.org/browse/SONARJAVA-759. If you leave
this property at its default value of "target/classes" the Java
plugin will fail with "Invalid value for sonar.binaries" for projects
without Java source code.
-->
<sonar.java.binaries>${basedir}</sonar.java.binaries>
</properties>

I personally had intermittent luck with the various sonar exclusions properties in solving the problem of codeless modules. http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus



From: Franck Arnulfo [mailto:***@gmail.com]
Sent: Wednesday, January 21, 2015 12:32 PM
To: ***@sonar.codehaus.org<mailto:***@sonar.codehaus.org>
Subject: [sonar-user] Changing in sonar.java.binaries property behavior


Hello,

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,
--
Sent from Gmail Mobile
Loading...