How do I specify extra properties for Ivy dependencies?

My Ivy repository uses an extra “branch” property to separate modules. The ivy.xml path pattern is: ‘[organisation]/[module]/([branch]/)[revision]/ivy.xml’

How would I specify the branch when declaring a dependency in my gradle project?

I’ve already tried:

dependencies {
 compile group: "acme", name: "widget", branch: "trunk", version: "latest.integration", configuration: "foobar"
}

As far as I know, setting Ivy extra properties for dependencies is not supported. Perhaps you could solve this by conditionally configuring the Ivy pattern based on what the current branch is.

Each dependency may need to reference a different branch.

I found at least three issues in JIRA for this:

http://issues.gradle.org/browse/GRADLE-1358 http://issues.gradle.org/browse/GRADLE-991 http://issues.gradle.org/browse/GRADLE-940

So there’s definitely a need for it.

The best you can currently do is to define one repo per branch.