与Gradle的快照依赖关系

时间:2012-04-17 14:31:17

标签: maven dependencies gradle build.gradle

免责声明:我对Gradle很新。

我正在尝试使用Gradle(1.0-rc1)构建我的项目,使用来自Maven工件的Snapshot依赖项。

但是当我尝试使用gradle --info dependencies解决依赖关系时,我收到以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dependencies'.
> Could not resolve all dependencies for configuration ':compile'.
   > Could not resolve group:com.l2fprod, module:l2fprod-common-all, version:7.3.
     Required by:
         :test:unspecified > org.valkyriercp:valkyrie-rcp-core:1.1-SNAPSHOT
      > Could not HEAD 'https://raw.github.com/Ekito/maven-repo/master/ \
        snapshots/com/l2fprod/l2fprod-common-all/7.3/l2fprod-common-all-7.3.jar'.
   > Could not resolve group:org.valkyriercp, module:valkyrie-rcp-resources, 
     version:1.1-SNAPSHOT.
     Required by:
         :test:unspecified > org.valkyriercp:valkyrie-rcp-core:1.1-SNAPSHOT
      > Could not resolve group:org.valkyriercp, module:valkyrie-rcp, 
        version:1.1-SNAPSHOT.
         > Could not HEAD 'https://raw.github.com/Ekito/maven-repo/master/ \
           snapshots/org/valkyriercp/valkyrie-rcp/1.1-SNAPSHOT \
           /valkyrie-rcp-1.1-SNAPSHOT.jar'.

但Maven artefact valkyrie-rcp不是jar,而是pom,它是我试图下载的人工制品的父模块。

如果我使用Maven来构建项目,它会很有用。

这是一个简单的build.gradle文件,可以重现该问题:

apply plugin: 'java'

dependencies {
        compile group: 'org.valkyriercp', name:'valkyrie-rcp-core', version:'1.1-SNAPSHOT'
        compile 'org.slf4j:slf4j-log4j12:1.6.4'
}

repositories {
    mavenCentral()
    maven {
        url "https://raw.github.com/Ekito/maven-repo/master/snapshots/"
    }
}

我做错了什么?它是具有快照依赖性的Gradle错误吗?

1 个答案:

答案 0 :(得分:0)

我怀疑gradle如何处理快照依赖项(使用rc1为我工作的快照依赖项)是一个错误。

例外是

您确定所需的工件“com.l2fprod,module:l2fprod-common-all,version:7.3”在您的存储库中吗? (不应该对valkyrie-rcp-core的依赖是“com.l2fprod。常见,模块:l2fprod-common-all,version:7.3”?)