Maven、SonarQube 和排除未按预期工作

Maven, SonarQube & Exclusions not working as expected

参考 我在我的 POM 中添加了以下内容以排除生成的源文件,这些文件存在于 target/generated-sources/x/y/z.

</properties>
    <sonar.exclusions>file:**/generated-sources/**</sonar.exclusions>
</properties>

在我的日志文件中,我没有看到任何文件被排除在外,但是在我的项目目录中 target/generated-sources/x/y/z.

下有文件
[10:14:39.346] Source paths: pom.xml, src/main/java
[10:14:39.346] Test paths: src/test/java
[10:14:39.347] Binary dirs: target/classes
[10:14:39.348] Source encoding: UTF-8, default locale: de_DE
[10:14:39.348] Index files
[10:14:39.363] Excluded sources: 
[10:14:39.363]   file:**/generated-sources/**
[10:14:39.484] 47 files indexed
[10:14:39.487] 0 files ignored because of inclusion/exclusion patterns

我正在使用 SQ 5.1.1、Maven 3.2.3、Java8.

谁能赐教吗?

好吧,日志骗了我。生成的源从一开始就不是分析的一部分,因此它没有显示任何排除的文件。 当我更改排除模式以匹配来自 "src/main/java" 的文件时,它会记录预期的排除(并且不分析文件。)