Gradle’s ivy-publish plugin uses a non-standard ivy layout pattern. I found a mailing list post where this feature was implemented and the developer asked if anyone knew if there was a standard layout. They weren’t sure what the default ivy layout was and so used the maven layout. However, there is indeed a default ivy layout and it is different than the Maven layout. The fact that Gradle does not properly implement this makes it very difficult to interoperate with other tools. I was able to fix it by specificying the layout as shown below. I would love to see Gradle’s non-standard default be updated to the standard layout so that it will work with other tools.
publishing {
publications {
ivyJava(IvyPublication) {
from components.java
}
}
repositories {
ivy {
url "${System.properties['user.home']}/.ivy2/local"
layout 'pattern', {
artifact '[organisation]/[module]/[revision]/[ext]s/[artifact](.[ext])'
ivy '[organisation]/[module]/[revision]/[artifact]/[artifact](.[ext])'
}
}
}
}
You can see this is what is defined in ivysettings-local.xml except ivy has a [type] which gradle does not support so I had to replace it with [ext] and [artifact] in order to get the same result.
<property name="ivy.local.default.ivy.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/>
<property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/>