# testCompile dependencies not being picked up if "up-to-date" (1.7 & 1.8)

**URL:** <https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719>\
**Category:** Old Forum Archive\
**Created:** [September 25, 2013, 10:35pm UTC](https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719 "2013-09-25T22:35:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_D](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Scott\_D](https://discuss.gradle.org/u/Scott_D)\
**Post date:** [September 25, 2013, 10:35pm UTC](https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719/1 "2013-09-25T22:35:00Z")

</div>

we put the source and dependencies in build.gradle files in each package (following a previous convention for source code) “gradle clean test” works fine but if i do “gradle test” again it fails saying it cannot find the external library dependency i can workaround this failure by adding testRuntime at the root build.gradle file but this should not be a requirement

i think this failure occurs because the test compile is up-to-date such that the dependencies are not added from the package build.gradle prior to running the test this should not be the case, they should be added as documentation states:

testRuntime

The dependencies required to run the tests. By default, also includes the compile, runtime and test compile dependencies.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [September 25, 2013, 10:45pm UTC](https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719/2 "2013-09-25T22:45:00Z")

</div>

Can you provide a self-contained reproducible example? Chances are that something is wrong with your build script(s).

---

<div class="post-metadata">

**Author:** ![Scott\_D](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Scott\_D](https://discuss.gradle.org/u/Scott_D)\
**Post date:** [September 26, 2013, 5:10am UTC](https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719/3 "2013-09-26T05:10:00Z")

</div>

sent zip file via email to you

by the way, the problem did not occur until i defined buildDir in the base build.gradle should be a good hint

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [September 26, 2013, 6:09am UTC](https://discuss.gradle.org/t/testcompile-dependencies-not-being-picked-up-if-up-to-date-1-7-1-8/1719/4 "2013-09-26T06:09:00Z")

</div>

Each project needs to have its own build output directory. Also, it’s not common to put ‘build.gradle’ into the source tree, although it might work out fine.
