I have a question about publishing Ivy in Gradle.
From Ivy, I expect that if I publish an artifact, for example, with this dependency:
<dependency org="org.apache.ant" name="ant" rev="1+"/>
My published ivy.xml gets both a fixed and a dynamic version:
<dependency org="org.apache.ant" name="ant" rev="1.9.6" revConstraint="1+"/>
I want this also in Gradle. I have Gradle 2.10.
Here is my Gradle project:
apply plugin: "java"
group = 'org.wibble'
version = "1.2.3"
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.apache.ant', name: 'ant', version: '1+'
}
uploadArchives.repositories {
ivy { name "testrepo"; url "$buildDir/testrepo" }
}
If I run gradle uploadArchives, then the resulting ivy.xml has the following:
<dependency org="org.apache.ant" name="ant" rev="1+" conf="compile->default"/>
In the Gradle source code, I see that there is a means to write rev and revConstraint:
if (!dep.getDynamicConstraintDependencyRevisionId().equals(dependencyRevisionId)) {
<...>
writer.attribute("revConstraint", dep.getDynamicConstraintDependencyRevisionId().getRevision());
}
With debugging, I also see that this code is hit, but in my case both getDynamicConstraintDependencyRevisionId and dependencyRevisionId give '1+' at this stage, and version 1.9.6 is forgotten at this stage.
, , ivy.xml, Ivy?