Quantcast

sonar findbugs and ant task

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

sonar findbugs and ant task

MaxBernhardt

Hi all, 

 

we're using sonar with findbugs in a buildenvironment with ant. Currently we're facing a problem with the definition of the sonar properties for usage by the findbugs plugin. The following excerpt of our buildscript shows our setup: 

 

    <dirset id="sonar.source.dirset" dir="${build.single.basedir}/${versiontobuildwithprefix}_plugins/plugins">
       <include name="*/src" />
       <exclude name="*.test/src" />
    </dirset>
    <pathconvert pathsep="," property="sonar.sources" refid="sonar.source.dirset" />
    <dirset id="sonar.binary.dirset" dir="${build.single.basedir}">
      <include name="${versiontobuildwithprefix}_plugins/**/@dot" />
    </dirset>
    <pathconvert pathsep="," property="sonar.binaries" refid="sonar.binary.dirset" />
    <dirset id="sonar.tests.dirset" dir="${build.single.basedir}/${versiontobuildwithprefix}_plugins/plugins">
      <include name="*.test/src" />
    </dirset>
    <pathconvert pathsep="," property="sonar.tests" refid="sonar.tests.dirset" />
    <path id="sonar.libraries.fileset">
      <fileset dir="${build.single.basedir}/${versiontobuildwithprefix}/vendor">
        <include name="**/*.jar"/>
        <exclude name="**/*sources.jar"/>
      </fileset>
      </path>
    <pathconvert pathsep="," property="sonar.libraries" refid="sonar.libraries.fileset" targetos="unix" />

This setup works fine for PMD and Checkstyle, but for findbugs it seems that only the first directory mentioned in the sonar.binaries property is analyzed, while the rest is used as an "AuxClasspathEntry". An excerpt from the findbugs-result.xml looks like follows: 

 

  <BugCollection version="2.0.0" sequence="0" timestamp="1343815489000" analysisTimestamp="1343816894008" release="">
    <Project>
      <Jar>/ccbuild/xxx/xxx/xxx/xxx_plugins/plugins/bs.client/@dot</Jar>
      <AuxClasspathEntry>/ccbuild/xxx/xxx/xxx/xxx_plugins/plugins/bs.server/@dot</AuxClasspathEntry>
      ....

 

I found a similar entry in this mailinglist from March 2011, but no solution was provided. Can somebody tell me what I'm doing wrong ? Or is this really a bug, that I should report in JIRA ?  

 

Cheers 

Max 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

MaxBernhardt
Hi,

does anybody have an idea ?

Cheers
Max
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

David Racodon-2
Hi Max,

Could you please send us a simple but complete example to reproduce your issue?
Which version of the Sonar Ant Task are you using?

Thank you

Regards,

David RACODON | SonarSource
Senior Consultant



On 3 August 2012 10:58, MaxBernhardt <[hidden email]> wrote:
Hi,

does anybody have an idea ?

Cheers
Max



--
View this message in context: http://sonar.15.n6.nabble.com/sonar-findbugs-and-ant-task-tp5001561p5001603.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

MaxBernhardt
Hi David,
 
currently I'm using version 1.3. I'll try to cobble together a complete example till next week. In between I'll also upgrade the task to version 1.4 and check whether the problem might have been solved in the meantime.
 
Cheers
Max
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

MaxBernhardt

 

Hi David,

 

here's the example. Just unzip the archive, adjust to your local sonar server (in build.sonar.xml) and run ant.  

 

You'll see that the rule "Bad practice - Confusing method names" is only found in de.mb.st.one.client.OneClient and not in de.mb.st.two.client.TwoServer.

 

I've added the result files under results. The findbugs file shows, that only the first directory /home/ccuser/sonar-ex2/bin/client is tested. The second directory /home/ccuser/sonar-ex2/bin/server is not tested but used as an AuxClasspathEntry.

 

I've not upgraded to 1.4, will do that on Monday.

 

Cheers

Max


MaxBernhardt <[hidden email]> hat am 8. August 2012 um 19:24 geschrieben:

> Hi David,

> currently I'm using version 1.3. I'll try to cobble together a complete
> example till next week. In between I'll also upgrade the task to version 1.4
> and check whether the problem might have been solved in the meantime.

> Cheers
> Max
>
>
>
>
> --
> View this message in context: http://sonar.15.n6.nabble.com/sonar-findbugs-and-ant-task-tp5001561p5001791.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

sonar-ex2.zip (55K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

MaxBernhardt
Hi David,

in the meantime I've upgraded to ant-task 1.4. The behavior is unchanged.

Cheers
Max
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

David Racodon-2
In reply to this post by MaxBernhardt
Hi Max,

I confirm that I've reproduced the issue.
I raised a JIRA ticket against it: http://jira.codehaus.org/browse/SONARPLUGINS-2155.

Regards,

David RACODON | SonarSource
Senior Consultant



On 10 August 2012 13:13, [hidden email] <[hidden email]> wrote:

 

Hi David,

 

here's the example. Just unzip the archive, adjust to your local sonar server (in build.sonar.xml) and run ant.  

 

You'll see that the rule "Bad practice - Confusing method names" is only found in de.mb.st.one.client.OneClient and not in de.mb.st.two.client.TwoServer.

 

I've added the result files under results. The findbugs file shows, that only the first directory /home/ccuser/sonar-ex2/bin/client is tested. The second directory /home/ccuser/sonar-ex2/bin/server is not tested but used as an AuxClasspathEntry.

 

I've not upgraded to 1.4, will do that on Monday.

 

Cheers

Max


MaxBernhardt <[hidden email]> hat am 8. August 2012 um 19:24 geschrieben:

> Hi David,

> currently I'm using version 1.3. I'll try to cobble together a complete
> example till next week. In between I'll also upgrade the task to version 1.4
> and check whether the problem might have been solved in the meantime.

> Cheers
> Max
>
>
>
>

> --
> View this message in context: http://sonar.15.n6.nabble.com/sonar-findbugs-and-ant-task-tp5001561p5001791.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

MaxBernhardt
Thanks for the confirmation and the info.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

Assaf Katz
Hi,
Is there release date for fixing this problem (taking only first binaries directory in findbugs)?
Thanks,
Assaf

-----Original Message-----
From: MaxBernhardt [mailto:[hidden email]]
Sent: Tuesday, August 14, 2012 16:02
To: [hidden email]
Subject: [sonar-user] Re: sonar findbugs and ant task

Thanks for the confirmation and the info.



--
View this message in context: http://sonar.15.n6.nabble.com/sonar-findbugs-and-ant-task-tp5001561p5001954.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sonar findbugs and ant task

Freddy Mallet
Hi Assaf,

In fact this bug fulling depends on http://jira.codehaus.org/browse/SONAR-3739 that should be fixed in upcoming Sonar 3.5.

Kind regards

-----
Sonar for Continuous Inspection


On Mon, Jan 21, 2013 at 9:20 AM, Assaf Katz <[hidden email]> wrote:
Hi,
Is there release date for fixing this problem (taking only first binaries directory in findbugs)?
Thanks,
Assaf

-----Original Message-----
From: MaxBernhardt [mailto:[hidden email]]
Sent: Tuesday, August 14, 2012 16:02
To: [hidden email]
Subject: [sonar-user] Re: sonar findbugs and ant task

Thanks for the confirmation and the info.



--
View this message in context: http://sonar.15.n6.nabble.com/sonar-findbugs-and-ant-task-tp5001561p5001954.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Loading...