publish: Maven Central

resolves #74
This commit is contained in:
Adrian 2023-03-03 15:44:44 -05:00
parent 04264b0ebd
commit d294957fb7
No known key found for this signature in database
GPG Key ID: FB8EF84DCE1BE452
5 changed files with 68 additions and 49 deletions

View File

@ -1,14 +1,8 @@
plugins {
`java-library`
id("authmevelocity.publishing")
id("authmevelocity.spotless")
}
java {
withSourcesJar()
withJavadocJar()
}
dependencies {
compileOnly(libs.paper)
}
@ -18,8 +12,8 @@ tasks {
(options as StandardJavadocDocletOptions).run {
encoding = Charsets.UTF_8.name()
links(
"https://jd.adventure.kyori.net/api/4.11.0/",
"https://jd.adventure.kyori.net/text-minimessage/4.11.0/",
"https://jd.advntr.dev/api/4.12.0/",
"https://jd.advntr.dev/text-minimessage/4.12.0/",
"https://jd.papermc.io/paper/1.19/"
)
}

View File

@ -1,5 +1,4 @@
plugins {
`java-library`
id("authmevelocity.publishing")
id("authmevelocity.spotless")
}
@ -8,18 +7,13 @@ dependencies {
compileOnly(libs.velocity)
}
java {
withSourcesJar()
withJavadocJar()
}
tasks {
javadoc {
(options as? StandardJavadocDocletOptions)?.run{
(options as StandardJavadocDocletOptions).run{
encoding = Charsets.UTF_8.name()
links(
"https://jd.adventure.kyori.net/api/4.12.0/",
"https://jd.adventure.kyori.net/text-minimessage/4.12.0/",
"https://jd.advntr.dev/api/4.12.0/",
"https://jd.advntr.dev/text-minimessage/4.12.0/",
"https://jd.papermc.io/velocity/3.0.0/"
)
}

View File

@ -1,27 +1,47 @@
plugins {
id("net.kyori.indra.publishing")
`java-library`
`maven-publish`
signing
}
indra {
javaVersions {
testWith().add(17)
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
repositories {
maven {
credentials(PasswordCredentials::class.java)
val central = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshots = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
if (project.version.toString().endsWith("SNAPSHOT")) {
name = "SonatypeSnapshots"
setUrl(snapshots)
} else {
name = "OSSRH"
setUrl(central)
}
}
github("4drian3d", "AuthMeVelocity") {
ci(true)
}
gpl3OrLaterLicense()
publishReleasesTo("maven central", "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
publishSnapshotsTo("sonatype snapshots", "https://s01.oss.sonatype.org/content/repositories/snapshots/")
configurePublications {
artifactId = project.name
from(components["java"])
pom {
url.set("https://github.com/4drian3d/AuthMeVelocity")
licenses {
license {
name.set("GNU General Public License version 3 or later")
url.set("https://opensource.org/licenses/GPL-3.0")
}
}
scm {
connection.set("scm:git:https://github.com/4drian3d/AuthMeVelocity.git")
developerConnection.set("scm:git:ssh://git@github.com/4drian3d/AuthMeVelocity.git")
url.set("https://github.com/4drian3d/AuthMeVelocity")
}
developers {
developer {
id.set("4drian3d")
@ -29,6 +49,25 @@ indra {
email.set("adriangonzalesval@gmail.com")
}
}
issueManagement {
name.set("GitHub")
url.set("https://github.com/4drian3d/AuthMeVelocity/issues")
}
ciManagement {
name.set("GitHub Actions")
url.set("https://github.com/4drian3d/AuthMeVelocity/actions")
}
name.set(project.name)
description.set(project.description)
url.set("https://github.com/4drian3d/AuthMeVelocity")
}
}
}
}
signing {
useGpgCmd()
sign(configurations.archives.get())
sign(publishing.publications["mavenJava"])
}

View File

@ -1,7 +1,3 @@
plugins {
id("net.kyori.indra.publishing.sonatype") version "3.0.1"
}
allprojects {
apply<JavaPlugin>()
@ -9,7 +5,3 @@ allprojects {
maven("https://repo.papermc.io/repository/maven-public/")
}
}
indraSonatype {
useAlternateSonatypeOSSHost("s01")
}

View File

@ -24,7 +24,7 @@ import net.byteflux.libby.relocation.Relocation;
public final class LibsManager {
private final LibraryManager manager;
public LibsManager(LibraryManager manager) {
public LibsManager(final LibraryManager manager) {
this.manager = manager;
manager.addMavenCentral();
}