Can you use the maven sonar scanner with analysis.mode=publish to detect a coverage failure locally? (Prior to a commit)

137 views
Skip to first unread message

julian...@gmail.com

unread,
Jan 25, 2017, 6:14:16 AM1/25/17
to SonarQube
Hi Everyone, 

I've been using using sonar at work on a large project with a large number of developers for over two years. I'm on sonar server 5.5 and sonar-runner2.5. I'm really thankful for the help this community has provided in the past. 

I'm generating jacoco and junit output from my builds using maven and surefire.

We've got a sonar scanner (not maven) running on our continuous integration server in analysis.mode=publish to send coverage results to the sonar server. 

It would be great if people could see their coverage results prior to pushing. (By running the sonar scanner locally with analysis.mode=publish on - and then parsing the job json api). 

My question is: Can you use the maven sonar scanner with analysis.mode=publish to detect a coverage failure locally? (Prior to a commit)

Cheers
Julian

G. Ann Campbell

unread,
Jan 25, 2017, 7:49:04 AM1/25/17
to SonarQube, julian...@gmail.com
Hi Julian,

First, "publish" is the default mode, so you don't need to specify it. 

Second, do not have developers run that kind of analysis locally before committing. Why? I've written on this subject before, and I'm lazy, so: http://stackoverflow.com/questions/39573851/how-does-sonarsonar-work/39574077#39574077


Ann
Reply all
Reply to author
Forward
0 new messages