Gradle and Ivy configuration

665 Views Asked by At

I have a module that was published on my own repository. Its ivy.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0">
    <info organisation="myorg" module="mymodule" revision="1.5" status="integration" publication="20161222140109"/>
    <configurations>
        <conf name="compile" visibility="public"/>
    </configurations>
    <publications>
        <artifact name="myartifact" type="zip" ext="zip" conf="compile"/>
    </publications>
    <dependencies/>
</ivy-module>

In another gradle project, I use this dependency:

configurations {
  compile
}

dependencies {
    compile 'myorg:mymodule:1.5'
}

What I expected was, that gradle would use the "compile"-configuration in my gradle script to download the "compile"-configuration of the ivy dependency.

What actually happens is that I get an error because Gradle searches for a "default" ivy-configuration. I know how I can add the configuration info to the dependency with configuration: 'compile' (see this question) but I would not like to do that manually if there is a more elegant way.

Question: Was I wrong by believing that Gradle uses the configurationName in the dependency declaration to search for the matching ivy-configuration? And do I really have to configure each ivy-configuration manually if I don't use default?

0

There are 0 best solutions below