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