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") + } + } + } +}