Install Free
Eclipse | Using SonarLint | File exclusions

File exclusions

On this page

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 defining 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.

Using Eclipse plugins to index your project

SonarLint uses some Eclipse plugins to index your project to exclude certain files and folders in your compilation or build output directories. This improves overall performance and lowers the memory footprint.

To opt out of these exclusions, right-click on your project, select Properties > SonarLint, and clear the Rely on Eclipse plugins checkbox.

Each project should be assessed individually. Changing your selection requires a restart of the IDE



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