Fix publishing

This commit is contained in:
Ivan Pekov 2021-01-22 17:06:28 +02:00
parent ecf1662547
commit 372911fcb1
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
3 changed files with 38 additions and 5 deletions

View File

@ -53,9 +53,4 @@ subprojects {
targetCompatibility = JavaVersion.current()
withSourcesJar()
}
publishing.repositories.maven {
url = uri("https://repo.codemc.io/repository/maven-snapshots/")
credentials(PasswordCredentials::class)
}
}

View File

@ -9,3 +9,26 @@ dependencies {
java {
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("api") {
from(components.getByName("java"))
}
}
repositories {
maven {
val releasesRepo = "https://repo.codemc.org/repository/maven-releases/"
val snapshotsRepo = "https://repo.codemc.org/repository/maven-snapshots/"
val versionString = project.version.toString()
url = if (versionString.endsWith("-SNAPSHOT")) {
uri(snapshotsRepo)
} else {
uri(releasesRepo)
}
credentials(PasswordCredentials::class)
}
}
}

View File

@ -5,3 +5,18 @@ repositories {
dependencies {
loadDependencies(project)
}
publishing {
publications {
create<MavenPublication>("server") {
from(components.getByName("java"))
}
}
repositories {
maven {
url = uri("https://repo.codemc.org/repository/nms-local/")
credentials(PasswordCredentials::class)
}
}
}