This repository showcases basic examples of usage and code coverage for SonarScanners.
- SonarScanner for Gradle
- SonarScanner for .NET
- SonarScanner for Maven
- SonarScanner CLI in a Java Ant project (Formerly SonarScanner for Ant - this scanner is now deprecated, use SonarScanner CLI)
- SonarScanner CLI
Sonar's Clean Code solution helps developers deliver high-quality, efficient code standards that benefit the entire team or organization.
SonarScanner for various languages
Scan all the languages available or change directory to a language folder to scan just that language.
Scanning an Ant project is no different than scanning a plain Java (no build tool) project. Ant is used to build the project, but not to run the scan. Instead, the SonarScanner CLI is used.
SonarScanner for Ant is now deprecated. Please migrate to the SonarScanner CLI.
If you have a Gradle project, we recommend the use of SonarScanner for Gradle or the equivalent gradle sonar task in your CI pipeline.
- SonarScanner for Gradle - Basic
- SonarScanner for Gradle - Kotlin DSL with build.gradle.kts
- SonarScanner for Gradle - Kotlin
- SonarScanner for Gradle - Multi-Module
- SonarScanner for Gradle - Multi-Module Code Coverage
If you have a Maven project, we recommend the use of SonarScanner for Maven or the equivalent mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar goal in your CI pipeline.
- SonarScanner for Maven - Basic
- SonarScanner for Maven - Multilingual (Java + Kotlin with coverage)
- SonarScanner for Maven - Multi-Module
If you have a .NET project, we recommend the use of SonarScanner for .NET or the equivalent SonarScanner for .NET on your CI pipeline.
SonarScanner - Swift Code Coverage
NOTE: All SonarScanner examples for C, C++ and Objective-C can be found here.
- SonarSource sample C and C++ projects with SonarCloud or SonarQube analysis configured
- C and C++ projects for different CI pipelines and build systems configured for Linux, Windows, and Mac
Copyright 2016-2026 SonarSource.
Licensed under the GNU Lesser General Public License, Version 3.0