Gradle:配置运行时声明对配置缺省的依赖性,该缺省未在

时间:2016-02-29 16:57:55

标签: java gradle repository ivy

你能告诉我为什么当我跑gradle时我得到这个错误:

Error:Module version trestGradle:trestGradle:1.0-SNAPSHOT, 
configuration 'runtime' declares a dependency on 
configuration 'default' which is not declared in the module 
descriptor for it.develop:myLib:1.0.0"

需要在ivy.xml(模块描述符)上声明什么?

  • MyLib位于内部常春藤存储库

  • 我检查过:凭据,常春藤网址和模式

的build.gradle:

group 'trestGrad'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.5

configurations {
    compile
}

repositories {
    ivy {
        url = 'http://example.com/artifactory/cst'
        credentials {
            username = "user"
            password = "pass123"
        }
        layout('pattern') {
            // Pattern to resolve Ivy descriptor files.
            ivy '[organization]/[module]/[revision]/[type]s/ivy.xml'
            // Pattern to resolve files.
            artifact '[organization]/[module]/[revision]/[type]s/[module].[ext]'
        }
    }
}

dependencies {
    compile "it.develop:myLib:1.0.0"
}

1 个答案:

答案 0 :(得分:6)

请参阅here

您需要指定依赖项的配置。失败的常春藤假定default配置,因此您的错误消息。