Now the system will usually have automated generated code, when using sonar for system code quality analysis, we want to be able to automatically generate code to exclude from the system analysis. This is very simple to implement, and in Maven's Pom.xml file, add sonar.exclusions to indicate which auto-generated code folders do not need to be parsed.
The specific matching rules can refer to sonar's official documentation, which is very simple (docs.sonarqube.org). Note The folder Foundation that is used to match the MAVEN project is Project base dir.
Wildcard Matches
? Match a single character
* * Match 0 or more folders
* Match 0 or more characters
Example:
- Excludes all Java files ending with Bean.java and Dto.java > sonar.exclusions=/*bean.java,/*dto.java
- Excludes all Java files in the folder "Src/main/java/org/sonar", excluding subfolders
sonar.exclusions=src/main/java/org/sonar/*
SONAR Specifies the Java project analysis file