I have a project configured in maven and the code analysis is done by SonarQube.
I am trying to configure SonarQube in the pom.xml file to exclude a few files from the code analysis. Those files can be identified by their class names, they contain the underscore character before the extension (they are metamodel classes). Below I give the part of the pom.xml file where I try to exclude them:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<sonar.sources>src/main/java</sonar.sources>
<sonar.exclusions>file:**/src/main/java/**/*_.*</sonar.exclusions>
</configuration>
</plugin>
However, the above code does not work. Is there a way to configure SonarQube from my pom.xml file to ignore those files when analysing the source code?
Thank you in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…