Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.13 KB

File metadata and controls

32 lines (24 loc) · 1.13 KB

SonarScanner for Gradle

This example demonstrates how to analyze a simple project built with Gradle. See SonarScanner for Gradle for more information.

Prerequisites

  • A gradle wrapper is included that bundles gradle. All other required plugins will be pulled by gradle as needed.

Usage

Run the following command (updating the sonar.host.url property as appropriate):

  • On Unix-like systems:
    ./gradlew build -Dsonar.host.url=http://myhost:9000 sonar
    
  • On Windows:
    .\gradlew.bat build -D'sonar.host.url=http://myhost:9000' sonar
    

Coverage

To get the project test coverage computed, add gradle task jacocoTestReport to your command line.

  • On Unix-like systems:
    ./gradlew build jacocoTestReport -Dsonar.host.url=http://myhost:9000 sonar
    
  • On Windows:
    .\gradlew.bat build jacocoTestReport -D'sonar.host.url=http://myhost:9000' sonar