How to pass sonar.leak.period from maven command line

428 views
Skip to first unread message

Oleg Marchuk

unread,
Dec 29, 2017, 7:14:48 AM12/29/17
to SonarQube
Hi, All

I tried to change a sonar.leak.period with -D. And it looks it doesn't work.


$ mvn sonar:sonar -Dsonar.leak.period=1.1 -e

$ mvn sonar:sonar -Dsonar.leak.period=2017-12-01 -e

Both of them doesn't work for me.

The related stackoverflow is https://stackoverflow.com/questions/48009928/passing-sonar-leak-period-to-sonar-maven-runner

Colin Mueller

unread,
Dec 29, 2017, 11:14:09 AM12/29/17
to SonarQube
Oleg,

You should set the leak period through the SonarQube UI (Project Dashboard > Administration > General Settings > Differential Views, at least in 5.6.7) . It defaults to previous_version. 

To achieve what you're trying to do, I would go into the "History" section of the administration drop-down on your project's dashboard. There you can edit snapshot metadata, including the version. If you rename your 1.2 version to 2.0, on next analysis the leak period should be on all new code since 1.1. Check out https://docs.sonarqube.org/display/SONAR/Managing+Project+History for some more details.

Colin

Oleg Marchuk

unread,
Jan 11, 2018, 4:14:53 AM1/11/18
to SonarQube
Thanks, Colin

Am I right this parameter cannot be passed from maven command line just because of lack of support in the maven sonar plugin?

Regards,
Oleg

gilbert...@googlemail.com

unread,
Jan 11, 2018, 5:35:38 AM1/11/18
to SonarQube
Hi Oleg,

you have to use the Web UI or the REST Api, see https://stackoverflow.com/q/42305795 for details.

Regards,
Gilbert

G. Ann Campbell

unread,
Jan 11, 2018, 8:49:46 AM1/11/18
to SonarQube
Hi,

To follow up on What Colin and Gilbert said, you cannot set this on an analysis by analysis basis. It must be set via the UI or related web services.


Ann
Reply all
Reply to author
Forward
0 new messages