I just set up a simple uploadArchives task for publication to our internal Ivy repo via WebDav:
group = 'com.example'
version = 'latest'
uploadArchives {
repositories {
ivy {
credentials {
username ivyUsername
password ivyPassword
}
url "http://hostname/repo"
}
}
}
When I run the task, Gradle returns the following error:
* What went wrong:
Execution failed for task ':smCommon:uploadArchives'.
> Could not publish configuration ':smCommon:archives'.
> java.io.IOException: Could not PUT 'http://hostname/repo/com.example/myproject/latest/myproject-latest.jar'. Received status code 409 from server: Conflict
The explanation for this per WebDav docs is, “A collection cannot be made at the Request-URI until one or more intermediate collections have been created.” And this is true: the full path for this artifact does not yet exist. Only “http://hostname/repo/com.example” exists.
I worked around this by logging on to my Ivy server and manually creating “/myproject/latest” in the repo, after which re-running the Gradle script successfully uploads the file.
Is this a bug, or is there something I’m doing incorrectly?