Gradle 插件重复版本 Artifactory 搜索
Gradle Plugin Duplicate Version Artifactory Search
我正在尝试在一个项目上应用一个插件,该插件是公司特定的 findbugs 插件。在我的父 gradle 项目中,我有以下内容:
dependencies {
findbugs 'com.google.code.findbugs.findbugs:3.0.1'
findbugs configurations.findbugsPlugins.dependencies
// Here we specify the findbugsPlugins
findbugsPlugins 'com.company.common.company-findbugs-plugin:1.01'
}
task findbugs(type: FindBugs) {
classes = fileTree(project.rootDir.absolutePath).include("**/*.class");
source = fileTree(project.rootDir.absolutePath).include("**/*.java");
classpath = files()
pluginClasspath = project.configurations.findbugsPlugins
findbugs {
toolVersion = "3.0.1"
sourceSets = [sourceSets.main]
ignoreFailures = true
reportsDir = file("$project.buildDir/findbugsReports")
effort = "max"
reportLevel = "high"
includeFilter = file("$rootProject.projectDir/include.xml")
excludeFilter = file("$rootProject.projectDir/exclude.xml")
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
}
但是,当我构建项目时,构建失败并报异常:
Could not resolve all dependencies for configuration ':findbugsPlugins'.
> Could not find com.company.common.company-findbugs-plugin:1.01:.
Searched in the following locations:
http://artifactory.company.com:8081/artifactory/repo/com/company/common/company-findbugs-plugin/1.01//1.01-.pom
http://artifactory.company.com:8081/artifactory/repo/com/company/common/company-findbugs-plugin/1.01//1.01-.jar
Required by:
com.company.project:ProjectName1.0.4
为什么 gradle 在路径末尾添加版本两次?
您错误地定义了 Gradle 依赖项,GroupId 和 ArtifactId 之间缺少冒号:
'com.google.code.findbugs:findbugs:3.0.1'
最有可能适用于
'com.company.common:company-findbugs-plugin:1.01'
我正在尝试在一个项目上应用一个插件,该插件是公司特定的 findbugs 插件。在我的父 gradle 项目中,我有以下内容:
dependencies {
findbugs 'com.google.code.findbugs.findbugs:3.0.1'
findbugs configurations.findbugsPlugins.dependencies
// Here we specify the findbugsPlugins
findbugsPlugins 'com.company.common.company-findbugs-plugin:1.01'
}
task findbugs(type: FindBugs) {
classes = fileTree(project.rootDir.absolutePath).include("**/*.class");
source = fileTree(project.rootDir.absolutePath).include("**/*.java");
classpath = files()
pluginClasspath = project.configurations.findbugsPlugins
findbugs {
toolVersion = "3.0.1"
sourceSets = [sourceSets.main]
ignoreFailures = true
reportsDir = file("$project.buildDir/findbugsReports")
effort = "max"
reportLevel = "high"
includeFilter = file("$rootProject.projectDir/include.xml")
excludeFilter = file("$rootProject.projectDir/exclude.xml")
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
}
但是,当我构建项目时,构建失败并报异常:
Could not resolve all dependencies for configuration ':findbugsPlugins'.
> Could not find com.company.common.company-findbugs-plugin:1.01:.
Searched in the following locations:
http://artifactory.company.com:8081/artifactory/repo/com/company/common/company-findbugs-plugin/1.01//1.01-.pom
http://artifactory.company.com:8081/artifactory/repo/com/company/common/company-findbugs-plugin/1.01//1.01-.jar
Required by:
com.company.project:ProjectName1.0.4
为什么 gradle 在路径末尾添加版本两次?
您错误地定义了 Gradle 依赖项,GroupId 和 ArtifactId 之间缺少冒号:
'com.google.code.findbugs:findbugs:3.0.1'
最有可能适用于
'com.company.common:company-findbugs-plugin:1.01'