Skip to content

Commit

Permalink
Use other plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Nov 23, 2024
1 parent 9972c3d commit dec6086
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 50 deletions.
55 changes: 55 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("eu.kakde.gradle.sonatype-maven-central-publisher") version "1.0.6"
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
Expand All @@ -21,3 +25,54 @@ dependencies {
testImplementation(libs.pojo.tester)
testCompileOnly(libs.jetbrains.annotations)
}

signing {
publishing.publications.configureEach {
sign(this)
}
sign(configurations.archives.get())
}

sonatypeCentralPublishExtension {
// Set group ID, artifact ID, version, and other publication details
groupId.set("com.faforever")
artifactId.set("api")
version.set("unspecified")
componentType.set("java") // "java" or "versionCatalog"
publishingType.set("USER_MANAGED") // USER_MANAGED or AUTOMATIC
shaAlgorithms.set(listOf("SHA-256", "SHA-512" ))

// Set username and password for Sonatype repository
username.set(project.properties["sonatypeUsername"].toString())
password.set(project.properties["sonatypePassword"].toString())

// Configure POM metadata
pom {
name.set("api")
description.set("API DTOs for FAForever Java API")
url.set("https://github.com/FAForever/faf-java-commons")
licenses {
license {
name.set("MIT")
url.set("https://www.opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("Brutus5000")
name.set("Brutus5000")
organization.set("FAForever")
organizationUrl.set("https://github.com/FAForever")
}
}
scm {
url.set("https://github.com/FAForever/faf-java-commons")
connection.set("scm:git:https://github.com/FAForever/faf-java-commons")
developerConnection.set("scm:git:https://github.com/FAForever/faf-java-commons")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/FAForever/faf-java-commons/issues")
}
}
}
50 changes: 0 additions & 50 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,5 @@ configure(subprojects) {

tasks.withType<Test> {
useJUnitPlatform()
}

configure<PublishingExtension> {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.properties["project_display_name"].toString())
description.set(project.properties["project_description"].toString())
url.set(project.properties["project_website"].toString())
issueManagement {
system.set("GitHub")
url.set(project.properties["project_issues"].toString())
}
scm {
url.set(project.properties["project_website"].toString())
connection.set("scm:git:${project.properties["project_vcs"].toString()}")
developerConnection.set("scm:git:${project.properties["project_vcs_git"].toString()}")
}
licenses {
license {
name.set("The MIT License (MIT)")
url.set("http://www.opensource.org/licenses/mit-license.php")
distribution.set("repo")
}
}
developers {
developer {
id.set("Brutus5000")
name.set("Brutus5000")
organization {
name.set("FAForever")
url.set("https://github.com/FAForever")
}
}
}
}
}
}

repositories {
maven {
name = "MavenCentral"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["sonatypeUsername"].toString()
password = project.properties["sonatypePassword"].toString()
}
}
}
}
}

0 comments on commit dec6086

Please sign in to comment.