SonarQube 排除目录 [英] SonarQube Exclude a directory
本文介绍了SonarQube 排除目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试排除 Sonar 分析的目录.我在 sonar-project.properties
文件中定义了以下属性:
I am trying to exclude a directory from being analyzed by Sonar. I have the following properties defined in my sonar-project.properties
file:
sonar.sources=src/java
sonar.exclusions=src/java/test/****/*.java
我的目录结构是:
src/java/dig
src/java/test/dig
当我运行 sonar-runner 时,我得到以下信息:
When I run the sonar-runner I get the following info:
INFO - Excluded sources:
INFO - src/java/test/**/*.java
INFO - Excluded tests:
INFO - **/package-info.java
但是当我检查分析结果时,测试目录中的所有包都还在.
But when I check the result of the analysis all the packages inside the test directory are still there.
我只需要告诉 Sonar 不要分析测试目录和其中的任何包.
I just need to tell Sonar to not analyze the test directory and any packages inside it.
推荐答案
试试这样的:
sonar.exclusions=src/java/test/**
这篇关于SonarQube 排除目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文