在不推动的情况下,使用Gradle在本地执行SonarQube分析
在我的build.gradle中,我有一个来自在不推动的情况下,使用Gradle在本地执行SonarQube分析,gradle,sonarqube,Gradle,Sonarqube,在我的build.gradle中,我有一个来自'org.sonaqube'插件的sonaqube任务。每当我运行gradle sonarqube,我都会得到以下错误: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrato
'org.sonaqube'
插件的sonaqube
任务。每当我运行gradle sonarqube
,我都会得到以下错误:
You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
在我的组织中,我没有SonarQube服务器的管理员权限,请让我知道如何在本地运行SonarQube analysis(预览分析),而不将结果推送到服务器
(我知道IntelliJ有一个SonarLint插件,可以在IDE中分析代码,但安装它的过程需要一个漫长的审批过程:)所以我不得不放弃它)
更新添加我的sonarqube任务配置
sonarqube {
def shortBranchName = versionDetails().branchName
properties {
property "sonar.host.url", 'http://dummy.net/'
property "sonar.forceAnalysis", "true"
property 'sonar.projectName', "[" + shortBranchName + "] " + rootProject.name
property 'sonar.projectKey', "${sonarQubeProjectBaseKey}"
property 'sonar.branch', shortBranchName
property 'sonar.projectDescription', "[" + shortBranchName + "] " + rootProject.name
property 'sonar.sourceEncoding', 'UTF-8'
}
}
您可以通过传递以下额外属性来启用预览模式和本地HTML报告:
-Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
然而,这项功能不久前就被弃用了,并且可能根本不适用于SonarQube和Gradle扫描仪的最新版本
在任何情况下,旧文档都在这里:
您是否按照中所述配置了渐变默认值?@segfault我配置了,请参阅更新的问题