【问题标题】:Gradle Plugin Duplicate Version Artifactory SearchGradle 插件重复版本工件搜索
【发布时间】:2016-08-22 13:18:14
【问题描述】:

我正在尝试在作为公司特定 findbugs 插件的项目上应用插件。在我的 Parent 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 在路径末尾添加两次版本的任何原因?

【问题讨论】:

    标签: java plugins gradle artifactory


    【解决方案1】:

    您错误定义了 Gradle 依赖项,GroupId 和 ArtifactId 之间缺少冒号

    'com.google.code.findbugs:findbugs:3.0.1'
    

    同样的情况很可能适用于

    'com.company.common:company-findbugs-plugin:1.01'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      • 2020-06-11
      • 2023-04-11
      • 2019-07-03
      • 2019-07-08
      • 2023-02-18
      相关资源
      最近更新 更多