SONAR Specifies the Java project analysis file

Source: Internet
Author: User

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:

  1. Excludes all Java files ending with Bean.java and Dto.java > sonar.exclusions=/*bean.java,/*dto.java
  2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.