From f7f68adad531a93b742f0240cde6739568b5781c Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Wed, 11 Sep 2024 15:37:27 +0200 Subject: [PATCH] Configure publishing --- build.gradle.kts | 12 ++++++++++++ .../src/main/kotlin/bluemap.base.gradle.kts | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 776e112..f079170 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,3 +11,15 @@ dependencies { annotationProcessor ( libs.lombok ) } + +publishing { + publications { + create("maven") { + groupId = project.group.toString() + artifactId = project.name + version = project.version.toString() + + from(components["java"]) + } + } +} diff --git a/buildSrc/src/main/kotlin/bluemap.base.gradle.kts b/buildSrc/src/main/kotlin/bluemap.base.gradle.kts index 30c0c07..7d5c871 100644 --- a/buildSrc/src/main/kotlin/bluemap.base.gradle.kts +++ b/buildSrc/src/main/kotlin/bluemap.base.gradle.kts @@ -1,10 +1,11 @@ plugins { java `java-library` + `maven-publish` id ( "com.diffplug.spotless" ) } -group = "de.bluecolored.bluemap" +group = "de.bluecolored" version = gitVersion() repositories { @@ -31,7 +32,7 @@ tasks.withType(AbstractArchiveTask::class).configureEach { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(16)) + toolchain.languageVersion = JavaLanguageVersion.of(21) withSourcesJar() withJavadocJar() } @@ -61,3 +62,17 @@ spotless { trimTrailingWhitespace() } } + +publishing { + repositories { + maven { + name = "bluecolored" + url = uri( "https://repo.bluecolored.de/releases" ) + + credentials { + username = project.findProperty("bluecoloredUsername") as String? ?: System.getenv("BLUECOLORED_USERNAME") + password = project.findProperty("bluecoloredPassword") as String? ?: System.getenv("BLUECOLORED_PASSWORD") + } + } + } +}