新的SonarQube Gradle插件在哪里? [英] Where is the new SonarQube Gradle Plugin?

查看:717
本文介绍了新的SonarQube Gradle插件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近从Gradle的早期版本升级,我开始发出警告,我应该使用官方的SonarQube插件: 'sonar-runner'插件已被弃用,并计划在Gradle 3.0中删除。请使用SonarQube官方插件(文档)。


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

  buildscript {
repositories {
maven {
urlhttps://plugins.gradle.org/m2/
}
}
依赖关系{
classpathorg.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2
}
}

apply plugin:org.sonarqube

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

 无法GET'https://plugins.gradle.org/平方米/组织/ sonarsource /扫描仪/ gradle这个/ sonarqube-gradle这个-插件/ 1.2 / sonarqube-gradle这个-插件-1.2.pom。 
> peer not authenticated

当我尝试通过浏览器访问相同的位置时,我得到了404,并且如果我从 https://plugins.gradle.org/m2/org 浏览文件结构,我可以尽量 https://jcenter.bintray.com/org/sonarsource/扫描仪/ ,但我在那里看到的唯一子目录是'ant','cli'和'maven',没有'gradle'。大概这是我的问题的根本原因。

从这里的其他问题,我可以看到其他人正在使用该插件,所以大概可以在某处使用,但我可以找不到它。任何建议工作源?

解决方案

我们通过添加

$


classpathorg.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2


构建脚本依赖关系。然后,我们添加了


apply plugin:'org.sonarqube'


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


Having recently upgraded from a previous version of Gradle, I started getting a warning that I should use the official SonarQube plugin:

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).

From that link, I was directed to the Gradle Plugins page for the new plugin (https://plugins.gradle.org/plugin/org.sonarqube), which tells me to use:

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

apply plugin: "org.sonarqube"

But that fails. The error I'm seeing in my Gradle output is:

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

When I try to access the same location through a browser, I get a 404, and if I browse the file structure from https://plugins.gradle.org/m2/org, I can go as far as https://jcenter.bintray.com/org/sonarsource/scanner/, but the only subdirectories I see there are 'ant', 'cli' and 'maven', no 'gradle'. Presumably this is the root cause of my problem.

From other questions on here, I can see that others are using the plugin, so presumably it's available somewhere, but I can't find it. Any suggestions on a working source?

解决方案

We got the plugin into Gradle by adding

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

to buildscript dependencies. We then added

apply plugin: 'org.sonarqube'

to activate it. Our local Artifactory instance is set up to proxy jCenter and mavenCentral.

这篇关于新的SonarQube Gradle插件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆