Disable Sonar rule using pom.xml?

扶醉桌前 提交于 2019-12-08 09:36:36

问题


I am using Spring Boot and Spring Jpa example and looking to disabled below Sonar rule through maven mainly using pom.xml file. I don't have access or can't go and disable that rule in SonarQube as it's configured for the Org level.

Methods should not have too many parameters (squid:S00107)

Can someone please guide me on that?

I already went through web many times and did not find any promising solutions yet. This is what I look at : Configure Sonar to exclude files from Maven pom.xml too.


回答1:


There seem to be a way of doing it but it may not be supported i.e.

<properties>
    <sonar.issue.ignore.multicriteria>e1<sonar.issue.ignore.multicriteria>
    <sonar.issue.ignore.multicriteria.e1.ruleKey>squid:S00107</sonar.issue.ignore.multicriteria.e1.ruleKey>
    <sonar.issue.ignore.multicriteria.e1.resourceKey>**/*.java</sonar.issue.ignore.multicriteria.e1.resourceKey>
</properties>

Refer to : https://community.sonarsource.com/t/documentation-about-ignore-issues-seems-to-be-wrong-or-outdated/3353

but they do state :

We recommend users to use the UI to configure this, for best experience. Consider the configuration via sonar-project.properties as an undocumented hack, not official supported that may or may not work reliably, use at your own risk.



来源:https://stackoverflow.com/questions/57789832/disable-sonar-rule-using-pom-xml

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