Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
486 views
in Technique[技术] by (71.8m points)

sonar runner - SonarQube Exclude a directory

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

The directory structure I have is:

src/java/dig
src/java/test/dig

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.

I just need to tell Sonar to not analyze the test directory and any packages inside it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try something like this:

sonar.exclusions=src/java/test/**

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...