Example taken from https://github.com/Baeldung/kotlin-tutorials/tree/master/gradle-kotlin-dsl
This example repository exemplifies usage of integrating SonarScanner for Gradle with Gradle's Kotlin DSL.
Obtain your user token from your own account. See Generating and using tokens for more information.
Run the following command (update sonar.host.url
, sonar.organization
, etc. properties as needed either at command line or in build.gradle.kts
's sonar
block):
- On Unix-like systems:
./gradlew clean build jacocoTestReport -Dsonar.host.url=http://localhost:9000 -Dsonar.login=<INSERT-USER-TOKEN> sonar
- On Windows:
.\gradlew.bat clean build jacocoTestReport -Dsonar.host.url=http://localhost:9000 -Dsonar.login=<INSERT-USER-TOKEN> sonar
Remove jacocoTestReport
task to remove coverage report task