gradle - SonarQube 在 detekt gradle 插件中是否有 gradle 设置以在远程主机上而不是在文件中生成报告
问题描述
当我使用 sonarqube 插件时,我无法在远程主机上生成关于使用我的特定分支的报告,因为最新版本不支持它并且不推荐使用 branch.name
因此,当我使用 detekt 插件时,它会在本地文件中生成报告,而不是在远程主机上。如何提供 gradle 设置以在远程主机上生成 html 报告就像我们使用 sonarqube 插件时使用属性 sonar.host.url 生成一样
我的 build.gradle 看起来像
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
}```
解决方案
嗨,我的代码适用于 id("org.sonarqube") 版本 2.7 我不需要 detekt 插件
我们发现未启用 sonarqube kotlin,这就是为什么当我们尝试使用任何其他分支运行它时,它总是说 master 分支为空,在服务器启用 kotlin 支持后,只需添加 sonarqube 服务器主机,它就可以用于任何分支。
推荐阅读
- java - 为什么 List.contains(Object) 的行为不同?
- r - 如何在同一个数据帧上做colsum和average
- powerbi - 使用 DAX 生成日期系列
- javascript - 仅在服务器上需要一个包
- java - Intellij IDEA 仅针对所有未提交的更改运行测试
- regex - 在换行符之前匹配字符,不包括空格?
- macos - MacOS - 使用带有launchd的脚本 - 启动,登录,注销,关闭?
- service-worker - Workbox 的服务人员在更改时未更新
- python - AllenNLP 共指分辨率的多 GPU 训练
- reactjs - 事件处理程序中带有 [name] 的 PrevState