新的 SonarQube Gradle 插件在哪里?

Where is the new SonarQube Gradle Plugin?

最近从以前的版本 Gradle 升级后,我开始收到警告,提示我应该使用官方 SonarQube 插件:

The 'sonar-runner' plugin has been deprecated and is scheduled to be removed in Gradle 3.0. please use the official plugin from SonarQube (the docs).

从那个 link,我被引导到新插件 (https://plugins.gradle.org/plugin/org.sonarqube) 的 Gradle 插件页面,它告诉我使用:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2"
  }
}

apply plugin: "org.sonarqube"

但这失败了。我在 Gradle 输出中看到的错误是:

Could not GET 'https://plugins.gradle.org/m2/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.pom'.  
> peer not authenticated

当我尝试通过浏览器访问同一位置时,我收到 404,如果我从 https://plugins.gradle.org/m2/org, I can go as far as https://jcenter.bintray.com/org/sonarsource/scanner/ 浏览文件结构,但我看到的唯一子目录是 'ant', 'cli' 和 'maven',没有 'gradle'。大概这是我问题的根本原因。

从这里的其他问题,我可以看到其他人正在使用该插件,所以大概它在某个地方可用,但我找不到它。对工作来源有什么建议吗?

我们通过添加

将插件添加到 Gradle

classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2"

构建脚本依赖项。然后我们添加了

apply plugin: 'org.sonarqube'

激活它。我们本地的 Artifactory 实例设置为代理 jCenter 和 mavenCentral。