diff --git a/build.gradle b/build.gradle index 742197c..a385a55 100644 --- a/build.gradle +++ b/build.gradle @@ -17,8 +17,8 @@ project.version = projectVersion repositories { mavenLocal() mavenCentral() - maven { url 'https://hub.spigotmc.org/nexus/content/groups/public' } - maven { url 'https://dmx-mc-project.gitlab.io/maven-repository/' } + maven repos.mavenSpigotMC + maven repos.mavenDmxMcProject } dependencies { diff --git a/buildSrc/src/main/groovy/libs/LibsPlugin.groovy b/buildSrc/src/main/groovy/libs/LibsPlugin.groovy index 0280438..a1a56d4 100644 --- a/buildSrc/src/main/groovy/libs/LibsPlugin.groovy +++ b/buildSrc/src/main/groovy/libs/LibsPlugin.groovy @@ -8,5 +8,6 @@ class LibsPlugin implements Plugin { @Override void apply(Project project) { project.extensions.create('libs', LibsExtention) + project.extensions.create('repos', ReposExtention) } } diff --git a/buildSrc/src/main/groovy/libs/ReposExtention.groovy b/buildSrc/src/main/groovy/libs/ReposExtention.groovy new file mode 100644 index 0000000..86ac380 --- /dev/null +++ b/buildSrc/src/main/groovy/libs/ReposExtention.groovy @@ -0,0 +1,20 @@ +package libs + +import org.gradle.api.Action +import org.gradle.api.artifacts.repositories.MavenArtifactRepository + +class ReposExtention { + + final def mavenSpigotMC = createSimpleMavenRepo('SpigotMC repository', 'https://hub.spigotmc.org/nexus/content/groups/public') + final def mavenDmxMcProject = createSimpleMavenRepo('DmitriyMX MC Project repository', 'https://dmx-mc-project.gitlab.io/maven-repository/') + + private static Action createSimpleMavenRepo(String name, String url) { + return new Action() { + @Override + void execute(MavenArtifactRepository mavenArtifactRepository) { + mavenArtifactRepository.setName(name) + mavenArtifactRepository.setUrl(url) + } + } + } +}