Gradle test doesn't use cached dependencies

Hi team,

I’m running gradle dependencies to install dependencies and then run gradle test to run test. My issue is that gradle test downloads dependencies that are already downloaded and cached. I see that these caches are installed under ~/.gradle/caches.

How can I make test to use cached dependencies?

Thanks for your help!

system info

ubuntu@box524:~$ uname -a
Linux box524 3.14.28-031428-generic #201501081937 SMP Thu Jan 8 19:39:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ubuntu@box524:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"

gradle version

$ gradle --version

------------------------------------------------------------
Gradle 1.10
------------------------------------------------------------

Build time:   2013-12-17 09:28:15 UTC
Build number: none
Revision:     36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_76 (Oracle Corporation 24.76-b04)
OS:           Linux 3.14.28-031428-generic amd64

Hi, is there anyone who is familiar with this?

I can’t understand what file would you like to compare?

In my understanding, you want to compare files used in compileTestJava task and files used in test task. If so, you can do it by comparing compileTestJava task’s classpath property and test task’s classpath propety(but this is the same files…).

If not, and what you wish is to compare jar files used by a project and jar files used another project, I think you have to create a plugin, which stores used file’s path into some datastore on each task execution, and each time compares it.