How do I check if an artifact exists in a remote repository using gradle?
I haven't been able to find any plugins for gradle that accomplish this.
I've had an idea of creating a function in build.gradle that checks if the url of the repository exists. But this doesn't seem like the right way of doing it.
Boolean ifExists = new URL(url).openConnection().with {
requestMethod = 'HEAD'
connect()
responseCode == 200
}
Any suggestions would be much appreciated.