How to specify customize output location for findbugs-results.xml file

162 views
Skip to first unread message

khandelw...@gmail.com

unread,
May 9, 2017, 8:57:07 AM5/9/17
to SonarQube
sonar.projectKey=java-sonar-runner
sonar.projectName=Project_Name
sonar.projectVersion=1.0

# Set modules IDs
sonar.modules=some_war
sonar.junit.reportsPath=sonar
sonar.findbugs.reportPath=./sonar/findbugs-result.xml
sonar.surefire.reportsPath=./sonar/findbugs-result.xml

# Modules inherit properties set at parent level
sonar.sources=src
sonar.binaries=target/classes
sonar.sourceEncoding=UTF-8
sonar.language=java


But none of the setting marked in bold are working, its still sending the findbugs-result.xml file to ${WORKSPACE}/java-sonar-runner_some_war/ location
Where I want the location to be fix relative to WORKSPACE, any suggestions?

I am using Sonar, Jenkin and findbugs

G. Ann Campbell

unread,
May 15, 2017, 12:08:11 PM5/15/17
to SonarQube, khandelw...@gmail.com
Hi,

First, please be aware that the standard courtesies are appreciated in this group (Hi, Thanks, ...).

To your question, those properties specify where reports should be read from, not where they should be output to.


Ann

ram.a...@gmail.com

unread,
May 16, 2017, 5:22:11 AM5/16/17
to SonarQube, khandelw...@gmail.com
Hello Ann Campbell,

I configured these paths so that sonar-scanner would include them while publishing batch report at the end of the scan. However, the additional findbugs-result.xml is not being parsed and results are not imported in sonnar-cube. 

What I am trying to do :
Pushing findbugs-result.xml manually to sonar-cube.

Could you please let me know if there is a way to achive this ? 

Kind regards
Ram

G. Ann Campbell

unread,
May 16, 2017, 7:09:51 AM5/16/17
to ram.a...@gmail.com, SonarQube, khandelw...@gmail.com
Hi,

Does your quality profile include FindBugs rules?


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/pVBgjiUMDLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/8623c1cb-1428-4b4c-b64e-e12d784f8618%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ram Kamath

unread,
May 16, 2017, 7:17:56 AM5/16/17
to G. Ann Campbell, SonarQube, khandelw...@gmail.com
Hello,

Yes. When I see in sonar-cube, it includes findbug quality profile. Attached is the screenshot.

Kind regards
Ram
findbug.png

G. Ann Campbell

unread,
May 16, 2017, 7:24:29 AM5/16/17
to Ram Kamath, SonarQube, khandelw...@gmail.com
Hi,

Your latest Quality Profile Event is "Stop using 'Findbugs + FB-contrib'".

So... it doesn't look like you are applying FindBugs rules.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Ram Kamath

unread,
May 16, 2017, 7:40:47 AM5/16/17
to G. Ann Campbell, SonarQube, khandelw...@gmail.com
Hello Ann,

Thanks for quick response.

I was just trying different combinations to make it work. I have enabled the said quality profile but without any luck. Is it technically possible to push an external report to sonarQube ? Like, I will execute findBugs in machine A and generate findbugs-result.xml which I will then push from machine B to sonarQube. 

Quality Profiles

Events

All
  • Version1.0

    16. Mai 2017

  • Quality ProfileUse 'FindBugs + FB-Contrib' (Java)

    16. Mai 2017

  • Quality ProfileStop using 'FindBugs' (Java)

    16. Mai 2017

  • Quality ProfileStop using 'FindBugs + FB-Contrib' (Java)

    16. Mai 2017

  • Quality ProfileUse 'FindBugs' (Java)

    16. Mai 2017

  • Quality ProfileUse 'FindBugs + FB-Contrib' (Java)

    16. Mai 2017

  • Quality ProfileStop using 'Custom profile' (Java)

    16. Mai 2017


G. Ann Campbell

unread,
May 16, 2017, 7:49:03 AM5/16/17
to Ram Kamath, SonarQube, khandelw...@gmail.com
Hi Ram,

I know it was possible a very long time ago, but I'm not seeing anything about it in the current documentation, and a very vague memory stirs that it might have been removed. Anyway, if your profile includes FindBugs rules, FindBugs analysis should happen automatically as part of the analysis.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Ram Kamath

unread,
May 18, 2017, 8:49:56 AM5/18/17
to G. Ann Campbell, SonarQube, Nikunj Khandelwal
Hello Ann,

A final followup question. You mentoned that properties file vales indicate from where the report should be read (To your question, those properties specify where reports should be read from, not where they should be output to.). Does that mean, if I keep a file in the respective directory they will be picked up during the scanning process ? because I tried and failed in that while using FindBugs.



On Tue, May 16, 2017 at 1:09 PM, G. Ann Campbell <ann.ca...@sonarsource.com> wrote:

G. Ann Campbell

unread,
May 18, 2017, 8:54:40 AM5/18/17
to Ram Kamath, SonarQube, Nikunj Khandelwal
Hi Ram,

As I said earlier, I remember that you used to be able to read a FindBugs report during analysis, but apparently that functionality has been removed. In general though, any paths you set in analysis properties are going to be about where analysis should read from.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Reply all
Reply to author
Forward
0 new messages