1+ plugins {
2+ id(" eu.kakde.gradle.sonatype-maven-central-publisher" ) version " 1.0.6"
3+ }
4+
15java {
26 sourceCompatibility = JavaVersion .VERSION_21
37 targetCompatibility = JavaVersion .VERSION_21
@@ -23,3 +27,54 @@ dependencies {
2327 testImplementation(libs.pojo.tester)
2428 testCompileOnly(libs.jetbrains.annotations)
2529}
30+
31+ signing {
32+ publishing.publications.configureEach {
33+ sign(this )
34+ }
35+ sign(configurations.archives.get())
36+ }
37+
38+ sonatypeCentralPublishExtension {
39+ // Set group ID, artifact ID, version, and other publication details
40+ groupId.set(" com.faforever" )
41+ artifactId.set(" api" )
42+ version.set(" unspecified" )
43+ componentType.set(" java" ) // "java" or "versionCatalog"
44+ publishingType.set(" USER_MANAGED" ) // USER_MANAGED or AUTOMATIC
45+ shaAlgorithms.set(listOf (" SHA-256" , " SHA-512" ))
46+
47+ // Set username and password for Sonatype repository
48+ username.set(project.properties[" sonatypeUsername" ].toString())
49+ password.set(project.properties[" sonatypePassword" ].toString())
50+
51+ // Configure POM metadata
52+ pom {
53+ name.set(" api" )
54+ description.set(" API DTOs for FAForever Java API" )
55+ url.set(" https://github.com/FAForever/faf-java-commons" )
56+ licenses {
57+ license {
58+ name.set(" MIT" )
59+ url.set(" https://www.opensource.org/licenses/mit-license.php" )
60+ }
61+ }
62+ developers {
63+ developer {
64+ id.set(" Brutus5000" )
65+ name.set(" Brutus5000" )
66+ organization.set(" FAForever" )
67+ organizationUrl.set(" https://github.com/FAForever" )
68+ }
69+ }
70+ scm {
71+ url.set(" https://github.com/FAForever/faf-java-commons" )
72+ connection.set(" scm:git:https://github.com/FAForever/faf-java-commons" )
73+ developerConnection.set(" scm:git:https://github.com/FAForever/faf-java-commons" )
74+ }
75+ issueManagement {
76+ system.set(" GitHub" )
77+ url.set(" https://github.com/FAForever/faf-java-commons/issues" )
78+ }
79+ }
80+ }
0 commit comments