Search code examples
gradlekotlinsonarqubedetekt

SonarQube Is there a gradle setting in detekt gradle plugin to generate report on remote host instead of in a file


When I use sonarqube plugin I'm not able to generate report on remote host on using my specific branch as lateast version is not supporting it and branch.name is deprecated

So When I use detekt plugin it generates report in file locally and not on remote host. How can provide gradle setting to generate html report on remote host Like it generates using property sonar.host.url when we use sonarqube plugin

my build.gradle looks like

 failFast = true // fail build on any finding
 buildUponDefaultConfig = true // preconfigure defaults
 config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
 baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt

 reports {
     html.enabled = true // observe findings in your browser with structure and code snippets
     xml.enabled = true // checkstyle like format mainly for integrations like Jenkins
     txt.enabled = true // similar to the console output, contains issue signature to manually edit baseline files
    html.destination =  "Remote host url"

 }

}```

 ```plugin {
  id("io.gitlab.arturbosch.detekt") version "1.5.1"
   id("org.sonarqube") version 2.7
 }```





Solution

  • Hi my code is working for id("org.sonarqube") version 2.7 I don't need detekt plugin

    We have found for sonarqube kotlin was not enabled thats why it was always saying master branch empty when we tried to run it with any other branch, after server enabled kotlin support simply by adding sonarqube server host it's working for any branch.