How can I check for new external dependencies without downloading artifacts?

Hi. I am looking to use gradle for dependency change polling, in our CI server.

Since polling runs frequently, I would like to ask gradle to evaluate its dependencies block (or even just a single dependency line) to find the latest artifact GAV, without actually downloading the artifacts.

For example, say I have a dependency – is there a way to ask gradle to evaluate the latest artifact GAV matching that criteria, without actually downloading it?

This would then allow us to compare it to a previous GAV and see if we need to trigger a new build.


Forgot to mention – using Gradle 2.0 with maven-publish plugin.

Why not let the incremental build (and dependency cache) take care of doing the minimal necessary work?

I would recommend the gradle-dependency-locking-plugin. That will let you have a source control version of which dependencies you want, while also declaring your ideal dependencies, e.g. 1.0.+. We run with the generateLock task every morning, and if the test pass, we check into the lock file. If the tests fail, we get an email from Jenkins and the old lock file stays in place.

Thanks @Justin, I will take a close look at this plugin.

It sounds pretty close to what we are looking for

@Peter, the main reason is because we are polling in virtualized environments, which will not have the dependency cache state around.

Each poll may occur on a different virtualized environment (likely without any dependency cache at all).

I can see that if there are only a few ‘test jobs’ around, that this could work, but we have hundreds.

Virtualized build environments often solve this by allowing to pin/cache files (such as the Gradle dependency cache) between builds.