Skip to content

Commit

Permalink
Add Maven publishing configuration to build script
Browse files Browse the repository at this point in the history
Integrated the `maven-publish` plugin and configured the `publishing` block to enable artifact publication. Publications are set up for snapshots or releases based on the version, with credentials sourced from environment variables.
  • Loading branch information
NonSwag committed Dec 24, 2024
1 parent 8d6b258 commit 183f9a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("java")
id("maven-publish")
}

group = rootProject.group
Expand Down Expand Up @@ -27,3 +28,17 @@ dependencies {

annotationProcessor("org.projectlombok:lombok:1.18.36")
}

publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
repositories.maven {
val channel = if ((version as String).contains("-pre")) "snapshots" else "releases"
url = uri("https://repo.thenextlvl.net/$channel")
credentials {
username = System.getenv("REPOSITORY_USER")
password = System.getenv("REPOSITORY_TOKEN")
}
}
}

0 comments on commit 183f9a5

Please sign in to comment.