Switch deployment to the central repository

This commit is contained in:
NotMyFault 2021-09-04 13:58:16 +02:00
parent f036980dc5
commit c18b0f943c
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C

View File

@ -6,6 +6,7 @@ plugins {
java
`java-library`
`maven-publish`
signing
alias(libs.plugins.shadow)
alias(libs.plugins.licenser)
@ -21,7 +22,11 @@ val versionsuffix: String? by project
if (versionsuffix != null) {
versuffix = "-$versionsuffix"
}
version = ver + versuffix
version = if (!project.hasProperty("release")) {
ver + versuffix
} else {
ver
}
allprojects {
group = "com.plotsquared"
@ -59,22 +64,11 @@ subprojects {
plugin<MavenPublishPlugin>()
plugin<ShadowPlugin>()
plugin<Licenser>()
plugin<SigningPlugin>()
plugin<EclipsePlugin>()
plugin<IdeaPlugin>()
}
tasks {
// This is to create the target dir under the root project with all jars.
val assembleTargetDir = create<Copy>("assembleTargetDirectory") {
destinationDir = rootDir.resolve("target")
into(destinationDir)
from(withType<Jar>())
}
named("build") {
dependsOn(assembleTargetDir)
}
}
}
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name)
@ -88,7 +82,6 @@ allprojects {
plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
vendor.set(JvmVendorSpec.ADOPTOPENJDK)
}
}
@ -103,6 +96,13 @@ allprojects {
withJavadocJar()
}
signing {
if (!version.toString().endsWith("-SNAPSHOT")) {
signing.isRequired
sign(publishing.publications)
}
}
publishing {
publications {
create<MavenPublication>("maven") {
@ -111,6 +111,11 @@ allprojects {
from(components["java"])
pom {
name.set(project.name + " " + project.version)
description.set("PlotSquared is a land and world management plugin for Minecraft.")
url.set("https://github.com/IntellectualSites/PlotSquared")
licenses {
license {
name.set("GNU General Public License, Version 3.0")
@ -143,6 +148,11 @@ allprojects {
connection.set("scm:https://IntellectualSites@github.com/IntellectualSites/PlotSquared.git")
developerConnection.set("scm:git://github.com/IntellectualSites/PlotSquared.git")
}
issueManagement{
system.set("GitHub")
url.set("https://github.com/IntellectualSites/PlotSquared/issues")
}
}
}
}
@ -158,11 +168,11 @@ allprojects {
val nexusPassword: String? by project
if (nexusUsername != null && nexusPassword != null) {
maven {
val repositoryUrl = "https://mvn.intellectualsites.com/content/repositories/releases/"
val snapshotRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/snapshots/"
val releasesRepositoryUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotRepositoryUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(
if (version.toString().endsWith("-SNAPSHOT")) snapshotRepositoryUrl
else repositoryUrl
else releasesRepositoryUrl
)
credentials {
@ -179,7 +189,6 @@ allprojects {
tasks {
named<Delete>("clean") {
doFirst {
rootDir.resolve("target").deleteRecursively()
javadocDir.deleteRecursively()
}
}
@ -201,7 +210,6 @@ allprojects {
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"
)
opt.destinationDirectory = javadocDir
}
jar {