Is it possible to define a set of repositories as ...
# gradle
r
Is it possible to define a set of repositories as a variable in kotlin DSL to be reused downstream? Something like this is what I'd like to do:
Copy code
val repos: RepositoryHandler by configurations.creating {
  maven("mycompanyRepo")
  maventCentral()
}

buildscript {
  repositories = repos
}
v
Define a convention plugin that declares your repositories and then apply that convention plugin.
buildscript { ... }
repositories you should usually not use anyway. If you feel a need for them, it is most often better to create a custom task or plugin with the necessary logic to keep the actual buildscript more declarative.