有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Gradle:configuration runtime声明了对配置默认值的依赖关系,该依赖关系未在的模块描述符中声明

您能告诉我为什么在运行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"

需要在常春藤上声明的内容。xml(模块描述符)

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

  • 我检查了:凭证、常春藤url和模式

建造。格拉德尔:

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) 个答案

  1. # 1 楼答案

    here

    您需要为依赖项指定配置。如果失败,ivy将采用default配置,因此会显示错误消息