How to get URLs for dependencies?

I’m trying to setup a special launch package for my projects, and I need the resolved URLs of all the downloaded dependencies. Is this information available or is there some other way I can download the dependencies so I don’t need this information.

Might be able to help you out better if you elaborate on what exactly it is you are trying to accomplish, but if all you want Gradle to do is download dependencies you can surely do that.

repositories {

mavenCentral()

}

configurations {

download

}

dependencies {

download ‘commons-logging:commons-logging:1.2’

}

task download(type: Copy) {

from configurations.download

into “${buildDir}/download”

}

I’m actually just wanting the URLs so that my own Java program can download them to the client computer so that they’re not part of the jar. I can copy the already fetched deps easily.

There is no way to get that via the API that I’m aware of. Gradle should print the URL out to the console when downloading the artifact however. You may have to clear out your ‘~/.gradle/caches’ directory to force the artifacts to redownload.

Hmm, that could be an option too, but I can see that failing in many ways. I think I’ll just work on improving the resolver I wrote.