Setting sonar profile together with sonar preview mode on maven command line

你说的曾经没有我的故事 提交于 2019-12-11 02:02:50

问题


I want to use a specific sonar profile with analysis mode preview for generating comments that go into our github pull requests.

The default quality profile for the project includes minor and info level rules which will cause hundreds of extra comments (and literally thousands of github notification emails). So it has to be a quality profile specific to this purpose.

Running the build like this:

mvn sonar:sonar -Dsonar.profile.java=PRComments -Dsonar.analysis.mode=preview

Fails with the following error:

sonar.profile was set to 'PRComments' but didn't match any profile for any language. 

The PRComments quality profile exists and works perfectly if I don't specify the preview mode. And yes I know that -Dsonar.profile is deprecated and it makes me sad too.

For info I'm using the sonarqube github plugin http://docs.sonarqube.org/display/PLUG/GitHub+Plugin to push the comments into github - but the failure above appears even if I don't use this plugin. Unfortunately the github plugin doesn't seem to have an option to skip adding comments for violations below a configurable severity level.

Is this possible or do I have to give up?

来源:https://stackoverflow.com/questions/38994996/setting-sonar-profile-together-with-sonar-preview-mode-on-maven-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!