This message was deleted.
# community-support
s
This message was deleted.
v
This is exepcted. Either you declare the repos in the settings, or you declare it in the projects. If you do both and do not declare a mode, settings if used if no project repo is declared and if project repos are declared, those are used. You can configure it to always use the settings declared ones and let Gradle warn you if a plugin or project adds repositories, or you can make the build fail if a plugin or project tries to add repositories.
p
Hm, thanks for the answer. Maybe it is possible with a custom settings plugin and project plugin to prevent copying the repos 😄
e
p
I simply use 2 plugins, one for the settings, and one for the project:
Copy code
class MyRepos : Plugin<Settings> {
    override fun apply(settings: Settings) {
        settings.dependencyResolutionManagement {
            repositories {
                repos()
            }
        }
    }
}
fun RepositoryHandler.repos() { }
class Repos: Plugin<Project> {
    override fun apply(project: Project) {
        project.repositories.apply {
            repos()
        }
    }
}