# How can i exclude jars/dependencies from test \[solved\]

**URL:** https://discuss.gradle.org/t/how-can-i-exclude-jars-dependencies-from-test-solved/10809
**Category:** Help/Discuss
**Created:** [July 27, 2015, 3:24am UTC](https://discuss.gradle.org/t/how-can-i-exclude-jars-dependencies-from-test-solved/10809 "2015-07-27T03:24:37Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![frankybooz](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@frankybooz](https://discuss.gradle.org/u/frankybooz)
#### Post date: [July 27, 2015, 12:44pm UTC](https://discuss.gradle.org/t/how-can-i-exclude-jars-dependencies-from-test-solved/10809/3 "2015-07-27T12:44:08Z")

</div>

thx raffael for your answer.  
unfortunately it doesn’t work that way either. ‘testRuntime’ uses the libs/classpaths from runtime, which i want to prevent. i’ve checked it with:

```
 test {
    configurations.testCompile.each { println "testCompile:" + it } 
}

```

i’ve solved it with a little workaround using the war plugin and a new configuration:

```
configurations {
    addWarArchive
}
war {
   // additional libraries only for the war-archive.
   classpath configurations.addWarArchive 
}
dependencies {
    ... 
    addWarArchive 'org.jboss.weld.servlet:weld-servlet:2.2.+'
    ...
}

```

thanks again, and hope this helps others.

---

_[View the full topic](https://discuss.gradle.org/t/how-can-i-exclude-jars-dependencies-from-test-solved/10809)._
