生成的源通常最终(使用maven)位于
target/generated-sources
,对于maven插件
target/generated-sources/plugin
是的。
您可以排除这些完整的目录
excludeRoots
,例如
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<executions>
<execution>
<id>pmd-verify</id>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
<configuration>
<printFailingErrors>true</printFailingErrors>
<excludeRoots>
<excludeRoot>target/generated-sources/plugin</excludeRoot>
</excludeRoots>
</configuration>
</execution>
</executions>
</plugin>
还有一个基于文件的
exclude
选择。