Dependency from an arbitrary URL (again)

There might be a workaround by declaring your remote location as an ‘ivy’ repository. If Gradle can’t find the ‘ivy.xml’ file, it will then look for a ‘jar’ file matching the artifact pattern. If this jar file is found, it’s treated like a fully-fledged ‘ivy module’ with no dependencies.

No guarantees, but you may be able to do this by declaring a repository with a pattern like:

dependencies {
  myconfiguration "anything:foo:1.4"
}
repositories {
  ivy {
    url "http://targethost"
    layout 'pattern' , {
        ivy '[module]-ivy.xml'
        artifact '[module](.[ext])'
    }
  }
}

If it’s not working, check out the ‘–debug’ output to see what actual URL is being requested. The resolver will first look for an ivy file using the ‘ivy’ pattern, and failing that it will check for an artifact file using the ‘artifact’ pattern. If the artifact is found, it should be used like any other remote dependency.