Skip to content

Commit

Permalink
added maven publish
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Dec 10, 2023
1 parent 7c47925 commit bdb1279
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
plugins {
id("java")
id("maven-publish")
}

group = rootProject.group
version = rootProject.version
version = "1.0.0"

java {
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_19
withJavadocJar()
withSourcesJar()
}

repositories {
Expand All @@ -23,3 +26,19 @@ dependencies {

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

publishing {
publications.create<MavenPublication>("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()
}
}
}

0 comments on commit bdb1279

Please sign in to comment.