【发布时间】:2020-07-28 00:04:04
【问题描述】:
早安,
以下是我在build.gradle中的部分代码:
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
}
}
plugins {
//id 'org.sonarqube' version '2.6.2'
id 'org.sonarqube' version '2.8'
}
apply plugin: 'nebula.nebula-release'
apply plugin: "org.sonarqube"
apply from: "gradle/locations.gradle"
apply from: "gradle/buildEnvironment.gradle"
apply from: "gradle/project.gradle"
apply from: "gradle/versions.gradle"
apply from: "gradle/jacoco.gradle"
apply from: "gradle/sonarqube.gradle"
apply from: "gradle/testing.gradle"
当我运行 gradle 命令时,它会遇到以下错误:
* What went wrong:
Plugin [id: 'org.sonarqube', version: '2.8'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.sonarqube:org.sonarqube.gradle.plugin:2.8')
Searched in the following repositories:
Gradle Central Plugin Repository
但是,如果我将 build.gradle 中的 id 'org.sonarqube' version '2.8' 更改为 id 'org.sonarqube' version '2.6.2',它将构建成功。
我可以知道我犯了什么错误吗?
** 我对 gradle 很陌生 **
【问题讨论】:
标签: gradle plugins sonarqube version jcenter