Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Robolectric

  1. Robolectric downloads dynamically dependencies. It does not respect the repositories settings. To amke sure it uses a source that is not MavenCentral one must add the following in the root build.gradle.kts file.
allprojects {
    tasks.withType<Test> {
        systemProperty("robolectric.dependency.repo.id", "nexus")
        systemProperty("robolectric.dependency.repo.url", "https://<nexus_internal_url>:8443/repository/android-group/")
        systemProperty("javax.net.ssl.trustStoreType", "JKS")  // required for Robolectric 4.3.1 and JDK11
        systemProperty("robolectric.logging", "stdout")
    }
}