【发布时间】:2018-06-11 12:34:03
【问题描述】:
我们使用 Sonatype Nexus 作为人工制品存储库,在 Jenkins 中使用凭据进行配置,并且运行良好。
现在我正在尝试使用 gradlew 让一个 gradle 项目作为 jenkins 多分支管道作业运行,包括 sonarqube 代码扫描。
问题:
在 settings.gradle 中仅使用 rootProjekt.name 属性时
我收到此错误:
出了什么问题:在以下任何来源中都找不到插件 [id: 'org.sonarqube', version: '2.6.2']:
Gradle 核心插件(插件不在 'org.gradle' 命名空间中)
- Plugin Repositories (could not resolve plugin artifact 'org.sonarqube:org.sonarqube.gradle.plugin:2.6.2') 在 以下存储库: Gradle Central 插件库
sonarqube gradle 插件是在使用 Nexus Web UI 时找到的,但不是通过管道内的 gradle 找到的,它似乎只在 Gradle Central Plugin Repository 中搜索。 像这样使用 Settings.gradle 时:
pluginManagement {
repositories {
maven {
url "http://nexushost/content/groups/public/"
}
}
}
rootProject.name = 'fooBar'
它就像一个魅力。 如何告诉 gradle 它应该始终使用 sonatype nexus 主机而不需要 在 settings.gradle 中为每个 Job 配置它?
【问题讨论】: