Skip to content

Commit

Permalink
[ci skip] Add Maven publish plugin configuration
Browse files Browse the repository at this point in the history
Integrate the Maven publish plugin to build.gradle.kts for publishing artifacts. Configure script to handle snapshots and releases based on version, and set up repository credentials using environment variables.
  • Loading branch information
NonSwag committed Sep 1, 2024
1 parent d9c61e5 commit 517dc62
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("java")
id("maven-publish")
}

group = "net.thenextlvl.resolver"
Expand Down Expand Up @@ -37,4 +38,18 @@ dependencies {

tasks.test {
useJUnitPlatform()
}

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 517dc62

Please sign in to comment.