Reputation: 10526
I am writing a Gradle plugin, and I would like it to add repositories to the project.
How can I do so?
Upvotes: 3
Views: 1556
Reputation: 10526
Inside the apply
method of your Plugin<Project>
class, add the following:
project.repositories.mavenCentral()
project.repositories.maven()
More generally, call any function that you would place in the repositories
section of your build script from project.repositories
.
You can find entire list of such functions here: https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.dsl.RepositoryHandler.html
Upvotes: 4