Install Free
IntelliJ | Using SonarQube for IDE | File exclusions

File exclusions

On this page

All versions of SonarQube for IDE will fetch file exclusions from SonarQube (Server, Cloud) or SonarQube Community Build when you bind a project or update a binding while running in connected mode. Check the SonarQube Sever, SonarQube Cloud, and SonarQube Community Build documentation for information about defining your Analysis scope.

File exclusions in the IDE

Go to IntelliJ Settings > Tools > SonarQube for IDE > File Exclusions to define an exclusion pattern. SonarQube for IntelliJ will accept wildcard patterns as described in the SonarQube Server and SonarQube Cloud documentation.

Wildcard patterns

The recognized path-matching patterns are case-sensitive and defined using the following wildcards:

  • *  Match zero or more characters (not including the directory delimiter,  / ).
  • **  Match zero or more directory segments or files within the path.
  • ?  Match a single character (not including the directory delimiter,  / ).

Wildcard examples

  • The pattern  **/*.css
    • matches  anyDirectory/anyFile.css
    • doesn't match  org/sonar.api/MyBean.java
  • The pattern  **/*Bean.java
    • matches  org/sonar.api/MyBean.java
    • doesn't match org/sonar.api/mybean.java or org/sonar/util/MyDTO.java
  • The pattern  **/*Bean?.java
    • matches  org/sonar/util/MyOtherBean1.java
    • doesn't match  org/sonar/util/MyOtherBean.java
  • The pattern  org/sonar/*
    • matches  org/sonar/MyClass.java
    • doesn't match  org/sonar/util/MyClassUtil.java
  • The pattern  org/sonar/**/* is equivalent to org/sonar/** and
    • matches  org/sonar/anyDirectory/anyFile
    • matches org/sonar/MyClass.java
    • doesn't match  org/radar/MyClass.java

Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License