sonarqube: http://www.sonarqube.org
Ant sonarcheck Target Usage Examples
Here are some examples of what the ant sonarcheck target offers:
-
sonar.extensions: One sonar target that handles both single and multiple extensions specified in the property as a comma-separated list. If not specified, scans all extensions.
-
sonar.excludedExtensions: Removes extensions from consideration.
-
Defaults project name and project key to the first extension mentioned in the sonar.extensions property but should typically be overridden from the command line by the caller.
-
Doesn't include gensrc directories in the scan.
-
By default, excludes jalo classes, generated constants and *Standalone classes but users can override from the command line if they want these scanned using the sonar.exclusions property.
-
By default, scans for all programming languages and markup languages supported by the SonarQube server being used but you can override at the command line using the sonar.language property.
-
Includes all the usual ‘source’ and ‘test’ directories for each extension being scanned.
-
Examples of usage:
- Usual usage of scanning the handful of extensions that make up a module or project-specific implementation:
ant sonarcheck -Dsonar.extensions commercefacades,commerceservices,acceleratorfacades,acceleratorservices -Dsonar.projectName "Commerce Layer" -Dsonar.projectKey commercelayer
- Exclude some extensions from the list being scanned:
ant sonarcheck -Dsonar.extensions commercefacades,commerceservices,acceleratorfacades,acceleratorservices -Dsonar.projectName "Commerce Service Layer" -Dsonar.projectKey comservicelayer -Dsonar.excludedExtensions acceleratorfacades,commercefacade
- Scan a single extension defaulting project name and key to the extension name:
ant sonarcheck -Dsonar.extensions catalog
- Scan all extensions defaulting project name and key but including jalo classes, and others, that are normally omitted:
ant sonarcheck -Dsonar.exclusions ""
- Usual usage of scanning the handful of extensions that make up a module or project-specific implementation: