# Setting javax.net.ssl.trustStore Property test scope breaks dependency resolutuion

**URL:** <https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834>\
**Category:** Old Forum Archive\
**Created:** [August 21, 2014, 5:19pm UTC](https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834 "2014-08-21T17:19:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![citizenkahn](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/citizenkahn/32/7907_2.png) [@citizenkahn](https://discuss.gradle.org/u/citizenkahn)\
**Post date:** [August 21, 2014, 5:19pm UTC](https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834/1 "2014-08-21T17:19:00Z")

</div>

Does anyone know how I can insulate resolution from test properties?

After adding test scope setting of “javax.net.ssl.trustStore” I can no longer download artifacts from my http nexus installation. If I comment out the test scope property set the download works.

```gradle
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
apply plugin: "jacoco"
...
repositories {
  maven {
    url "http://mvn.mycorp:10000/nexus/content/groups/public"
  }
  mavenLocal()
}
  test {
    System.setProperty("javax.net.ssl.trustStore","$projectDir/mycorp.cacerts")
}
...

```

thanks

---

<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:** [August 22, 2014, 12:33am UTC](https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834/2 "2014-08-22T00:33:00Z")

</div>

The correct way to set system properties for tests is:

```gradle
test {
    systemProperty "javax.net.ssl.trustStore", "$projectDir/mycorp.cacerts"
    systemProperty ...
}

```

---

<div class="post-metadata">

**Author:** ![citizenkahn](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/citizenkahn/32/7907_2.png) [@citizenkahn](https://discuss.gradle.org/u/citizenkahn)\
**Post date:** [August 22, 2014, 2:01am UTC](https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834/3 "2014-08-22T02:01:00Z")

</div>

Oh, because otherwise it gets executed during config and impacts the entire project?

---

<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:** [August 22, 2014, 2:05am UTC](https://discuss.gradle.org/t/setting-javax-net-ssl-truststore-property-test-scope-breaks-dependency-resolutuion/5834/4 "2014-08-22T02:05:00Z")

</div>

Because you need to instruct (configure) the ‘test’ task to set the system property in the test JVM(s), rather than directly setting the system property in the Gradle JVM.
