Specify ivy configuration in gradle dependency

*爱你&永不变心* 提交于 2019-12-11 01:36:16

问题


I want to resolve dependencies from ivy repository but I don't know how to specify ivy configuration for it. I found that I should do it in this way:

myconf group: 'com.eu', module:'MyModule', version:'1.0.0', configuration: 'ivyconf'

but it doesn't work. When I run gradle dependencies command gradle returns this error:

Could not create a dependency using notation: {group=com.eu, module=MyModule, version=1.0.0, configuration=ivyconf}

My build doesn't use plugins. I want to download dependencies in simple build which should create product from downloaded dependencies.

Build looks like this:

group = 'com.eu'
version = '0.9a'

configurations {
    myconf
}

repositories {
    ivy  {
        url 'http://ivyrepo.local/ivyrep/shared'
        layout "pattern", {
            artifact "[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
        }
    }
}

dependencies {
    myconf group: 'com.eu', module:'MyModule', version:'1.0.0', configuration: 'ivyconf'
}

回答1:


Instead of module, it has to be name. (see "49.4. How to declare your dependencies" in the Gradle User Guide). The declared configuration (myConf) must match the configuration used in the dependencies block (installer).



来源:https://stackoverflow.com/questions/16911314/specify-ivy-configuration-in-gradle-dependency

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!