简体   繁体   中英

passing sonar parameter to maven through hudson

Have set up code analysis using sonar hudson and maven My plan is to run the analysis everyday so I am trying to pass the parameter in Hudson as :

clean install sonar:sonar -Dsonar.dynamicAnalysis=reuseReports **-Dsonar.projectDate=yyyy-     MM-dd**

Rather than entering / changing date everyday manually - is there a way I can make it a parameter which automatically changes everyday ? Thanks satish

Are you looking for the date/time of execution? Could you try to use -Dsonar.projectDate=${BUILD_ID} as a parameter? Check out localhost:8080/env-vars.html for available arguments you can pass to the sonar plugin.

You don't need to use "-Dsonar.projectDate": it is used only when you want to replay some analyses in the past. So you can just drop this parameter, Sonar will take the current date to timestamp your analysis.

Also, consider using the Sonar Hudson/Jenkins Plugin instead of calling directly Maven, this will help you: http://docs.codehaus.org/pages/viewpage.action?pageId=116359341

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM