0
votes

I am using Jenkins+Sonar+Ant+java. I am now triggering a Sonar analysis from Jenkins during the night. However, because our full analysis takes so long I would like to define a Jenkins job that analyses only past 1 days of code using the Cutoff plugin (so in every commit, Sonar would analyse the committed code + one day of new code. Actually I would like to analyse only the newly committed code, maybe Cutoff should be 0 then?). For this to work I think I need to setup two different Sonar project names. On Sonar server, I would then have projects "Full analysis" and "New code analysis". The question is, how to define th ename in Jenkins? I think somehow, the Ant task that starts Sonar analysis needs to take the project name from Jenkins, but how is this done?

2

2 Answers

1
votes

sonar ant task take project name from properties, you can specify sonar.projectKey and sonar.projectName for different analysis. details

0
votes

Define the properties sonar.projectKey and sonar.projectName on the ant command line, rather than in a properties file. In Jenkins, you can do this in the Advanced parameters of an Ant builder.