【问题标题】:Gradle dependency resolution error, <exclude org: module="l:ame="*" type="*Gradle 依赖解析错误,<exclude org: module="l:ame="*" type="*
【发布时间】:2014-02-25 05:44:55
【问题描述】:

在使用 Gradle 1.10 为 Web 应用程序项目运行“war”任务时,当我包含对 cxf-bundle 2.6.13 的依赖项时,开始出现以下错误:

Could not resolve all dependencies for configuration ':runtime'.
Could not resolve      <exclude org: module="l:ame="*" type="*.
Required by:
  :gradle_dep_issue_example:unspecified > org.apache.cxf:cxf-bundle:2.6.13
java.lang.IllegalArgumentException (no error message)

停止和启动 gradle 守护进程无效,清除 .gradle 文件夹也无效。但是,运行 war 任务并传递 --refresh-dependencies 选项确实可以解决问题。不幸的是,每次都必须使用 --refresh-dependencies 选项。

这是一个小的 build.gradle 文件,它将在“downloadRuntimeDeps”任务运行时重现该问题。

apply plugin: 'war'

repositories {
  mavenCentral()
}

dependencies {
  compile 'org.apache.cxf:cxf-bundle:2.6.13'
}

task downloadRuntimeDeps(type: Copy){
  from configurations.runtime
  into new File(getBuildDir(), "/runtime-deps/")
}

【问题讨论】:

    标签: gradle


    【解决方案1】:

    这个问题最终只影响了 gradle 1.10 版。我用 1.8 和 1.11 版本测试过,都没有这个问题。

    release notes for gradle 1.11 中没有包含引用此类问题的错误修复,因此我认为在解决看似无关的问题时已修复此问题。

    解决方案是升级我的所有项目以使用 gradle 1.11

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-17
      • 2014-11-12
      • 1970-01-01
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      • 2015-12-19
      • 1970-01-01
      相关资源
      最近更新 更多