Preview mode in SonarQube Scanner for Gradle

1,529 views
Skip to first unread message

Viktor Sadovnikov

unread,
Apr 13, 2016, 8:27:11 AM4/13/16
to SonarQube
Hi,

According to http://docs.sonarqube.org/display/PLUG/GitHub+Plugin, GitHub Plugin for SonarQube should be able to update pull requests in GitHub, when scanner is executed in preview mode.
Our project https://github.com/ContainerSolutions/minimesos/pull/387 uses Gradle and I'm switching it from Gradle Sonar Runner to SonarQube Scanner for Gradle.

However execution of

./gradlew clean jacocoTestReport sonarqube -Psonar.analysis.mode=preview -Psonar.github.oauth=<MY OTH TOKEN> -Psonar.github.repository=ContainerSolutions/minimesos -Psonar.github.pullRequest=387

still results in adding results to my SonarQube Server instead of previews being published in GitHub pull request.

How should I enable preview mode (http://docs.sonarqube.org/display/SONAR/SonarLint+for+Command+Line) in SonarQube Scanner for Gradle?

Thank you,
Viktor

Julien HENRY

unread,
Apr 13, 2016, 9:47:51 AM4/13/16
to SonarQube
Hi Viktor,

You are using wrong syntax to pass properties. Please replace -P by -D

See for example what we are using:

++

Julien

Viktor Sadovnikov

unread,
Apr 13, 2016, 11:24:08 AM4/13/16
to SonarQube
Thank you very much! I did not realise all properties are system properties.
It works with your suggestion. Thanks again!

vik...@sadovnikov.info

unread,
Apr 24, 2016, 7:30:56 AM4/24/16
to SonarQube
Thanks, Julien, again.
With your help I managed to connect SonarQube, Travis CI and GitHub together http://container-solutions.com/moved-ci-jenkins-travis/
Now someone need to put an effort to miss SonarQube findings in new code :-)


On Wednesday, April 13, 2016 at 3:47:51 PM UTC+2, Julien HENRY wrote:

Julien HENRY

unread,
Apr 25, 2016, 4:35:05 AM4/25/16
to SonarQube, vik...@sadovnikov.info
Nice!
Reply all
Reply to author
Forward
0 new messages