admin管理员组文章数量:1291175
When I open a PR on GitHub, SonarQube Cloud checks the source code and reports any problems. I also have the IntelliJ plugin "SonarQube for IDE" installed. By connecting the IDE plugin to SonarQube Cloud, the same rules are used in my IDE and on GitHub.
I want to exclude all the files in src/main/java/db/schema
from SonarQube analysis in both cases (in the IDE and on GitHub).
I've added a .sonarcloud.properties
file to my project root with the following property:
sonar.exclusions=src/main/java/db/schema/*
But when I manually trigger the SonarQube analysis in the IDE, violations in these files are reported.
When I open a PR on GitHub, SonarQube Cloud checks the source code and reports any problems. I also have the IntelliJ plugin "SonarQube for IDE" installed. By connecting the IDE plugin to SonarQube Cloud, the same rules are used in my IDE and on GitHub.
I want to exclude all the files in src/main/java/db/schema
from SonarQube analysis in both cases (in the IDE and on GitHub).
I've added a .sonarcloud.properties
file to my project root with the following property:
sonar.exclusions=src/main/java/db/schema/*
But when I manually trigger the SonarQube analysis in the IDE, violations in these files are reported.
Share Improve this question asked Feb 13 at 16:02 DónalDónal 187k177 gold badges584 silver badges844 bronze badges 4- Were you able to bind your project to SonarQube Cloud project ? – vht981230 Commented Feb 18 at 5:14
- 1 @vht981230 yes, it's in connected mode – Dónal Commented Feb 18 at 13:17
- Hi, when a project is connected to SonarQube or SonarCloud, exclusions defined in the server General Settings override your locally defined exclusions. – SeiryuV Commented Feb 20 at 11:54
- Docs -docs.sonarsource/sonarqube-cloud/administering-sonarcloud/… – Jeevan ebi Commented Feb 21 at 8:35
1 Answer
Reset to default 1As per the documentation
When running in Connected mode with SonarQube (Server, Cloud) or SonarQube Community Build, SonarQube for IDE will ignore local exclusions and fetch file exclusions from the SonarQube (Server, Cloud) server.
This points that the way to configure exclusions is different whether you are running in Connected mode or not.
Connected mode
When in Connected mode, go to the SonarCloud > Project Settings > General Settings > Analysis Scope then search for the Exclusions section and add this pattern
src/main/java/db/schema/**
Local mode
When not in Connected mode, IntelliJ doesn't read exclusions in .sonarcloud.properties
(as per the documentation). Instead, you'll want to create a sonar-project.properties
file add inside of it the exclusion
sonar.exclusions=src/main/java/db/schema/**
Note: you can read about other approaches in the answers to this very similar question, as well as this one.
本文标签: Exclude directory from SonarQube analysisStack Overflow
版权声明:本文标题:Exclude directory from SonarQube analysis - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741518910a2383060.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论