From af2833bff42f54038e5aaa23ab77c4d16b259595 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 6 Apr 2024 09:26:43 +0200 Subject: [PATCH] publish implementation for easier abstraction --- plugin/build.gradle.kts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 823cff4..52005af 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -3,12 +3,14 @@ import net.minecrell.pluginyml.paper.PaperPluginDescription plugins { id("java") + id("maven-publish") id("net.minecrell.plugin-yml.paper") version "0.6.0" id("com.github.johnrengelman.shadow") version "8.1.1" id("io.papermc.hangar-publish-plugin") version "0.1.2" } java { + withSourcesJar() targetCompatibility = JavaVersion.VERSION_19 sourceCompatibility = JavaVersion.VERSION_19 } @@ -124,4 +126,20 @@ hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing } } } +} + +publishing { + publications.create("maven") { + from(components["java"]) + } + repositories.maven { + val branch = if (version.toString().contains("-pre")) "snapshots" else "releases" + url = uri("https://repo.thenextlvl.net/$branch") + credentials { + if (extra.has("RELEASES_USER")) + username = extra["RELEASES_USER"].toString() + if (extra.has("RELEASES_PASSWORD")) + password = extra["RELEASES_PASSWORD"].toString() + } + } } \ No newline at end of file