# How to specify a single repo for ALL dependencies

**URL:** <https://discuss.gradle.org/t/how-to-specify-a-single-repo-for-all-dependencies/44281>\
**Category:** Help/Discuss\
**Created:** [November 17, 2022, 9:45pm UTC](https://discuss.gradle.org/t/how-to-specify-a-single-repo-for-all-dependencies/44281 "2022-11-17T21:45:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverhammermba](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/silverhammermba/32/10040_2.png) [@silverhammermba](https://discuss.gradle.org/u/silverhammermba)\
**Post date:** [November 17, 2022, 9:45pm UTC](https://discuss.gradle.org/t/how-to-specify-a-single-repo-for-all-dependencies/44281/1 "2022-11-17T21:45:15Z")

</div>

Our gradle build (version 7.4.2) runs on an isolated network that has no access to the Internet. It can only access our self-hosted maven mirror (an artifactory instance). So I want to ensure that all gradle dependencies (plugins + normal dependencies) can only be fetched from that one repo.

I thought this would suffice in our root settings.gradle.kts:

```gradle
pluginManagement {
    repositories {
        maven {
            url = uri("https://myartifactory.jfrog.io")
            credentials {
                username = System.getenv("ARTIFACTORY_API_USERNAME") ?: ""
                password = System.getenv("ARTIFACTORY_API_KEY")
            }
        }
    }
    includeBuild("gradle/plugins")
}

dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://myartifactory.jfrog.io")
            credentials {
                username = System.getenv("ARTIFACTORY_API_USERNAME") ?: ""
                password = System.getenv("ARTIFACTORY_API_KEY")
            }
        }
    }
}

```

I tested this on my local machine and it seemed to work, but it fails on our build machine because it turns out it’s still trying to use the Gradle Central Plugin repository and in fact cannot resolve the kotlin-dsl plugin from artifactory:

```gradle
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7')
  Searched in the following repositories:
    Gradle Central Plugin

```

Which I find weird for two reasons:

1. Why is Gradle Central Plugin listed there? How do I remove that as an option?
2. Why is my desired repository not listed as being searched?

For example I can browse my artifactory and see that it has an artifact at `https://myartifactory.jfrog.io/org/gradle/kotlin/kotlin-dsl/org.gradle.kotlin.kotlin-dsl.gradle.plugin/2.1.7/`. I don’t understand why gradle can’t resolve that.

---

<div class="post-metadata">

**Author:** ![silverhammermba](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/silverhammermba/32/10040_2.png) [@silverhammermba](https://discuss.gradle.org/u/silverhammermba)\
**Post date:** [November 17, 2022, 10:15pm UTC](https://discuss.gradle.org/t/how-to-specify-a-single-repo-for-all-dependencies/44281/2 "2022-11-17T22:15:38Z")

</div>

I figured it out. Because gradle/plugins is a separate gradle build, that `pluginManagement` block does not apply to it. I need to repeat that pluginManagement declaration in gradle/plugins/settings.gradle.kts
