Eclipse | Using SonarLint | File exclusions

Was this page helpful?

On this page

Install Free

File exclusions

All versions of SonarLint will fetch file exclusions from the SonarQube or SonarCloud server when you bind a project or update a binding while running in Connected Mode. Check the SonarQube and SonarCloud documentation for information about setting your Analysis scope.

File exclusions in the IDE

Defining file exclusions locally in SonarLint for Eclipse is possible. The exclusions can be defined globally for all projects in the workspace, or per project. The simplest way to exclude a file or folder in a project is to right-click on the files or folders you want to exclude in the resource explorer, and select SonarLint > Exclude.

You can also go to the SonarLint global settings in Eclipse preferences, and add global exclusions. SonarLint for Eclipse will accept Java glob patterns. Navigate to Window > Preferences > SonarLint (or Eclipse > Settings… > SonarLint for Mac OS) to access the File exclusions page in the Preferences panel.

File exclusions defined in Eclipse also apply when running in Connected Mode. When a project is bound to a SonarQube or SonarCloud project, exclusions defined in the server's General Settings are merged with locally defined exclusions.

Accepted patterns

To define local exclusions in SonarLint for Eclipse, you must use the Java glob pattern syntax as defined in the Oracle documentation.

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

Creative Commons License