Skip to content

Commit dec6086

Browse files
committed
Use other plugin
1 parent 9972c3d commit dec6086

File tree

2 files changed

+55
-50
lines changed

2 files changed

+55
-50
lines changed

api/build.gradle.kts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("eu.kakde.gradle.sonatype-maven-central-publisher") version "1.0.6"
3+
}
4+
15
java {
26
sourceCompatibility = JavaVersion.VERSION_21
37
targetCompatibility = JavaVersion.VERSION_21
@@ -21,3 +25,54 @@ dependencies {
2125
testImplementation(libs.pojo.tester)
2226
testCompileOnly(libs.jetbrains.annotations)
2327
}
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+
}

build.gradle.kts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,55 +16,5 @@ configure(subprojects) {
1616

1717
tasks.withType<Test> {
1818
useJUnitPlatform()
19-
}
20-
21-
configure<PublishingExtension> {
22-
publications {
23-
create<MavenPublication>("maven") {
24-
from(components["java"])
25-
pom {
26-
name.set(project.properties["project_display_name"].toString())
27-
description.set(project.properties["project_description"].toString())
28-
url.set(project.properties["project_website"].toString())
29-
issueManagement {
30-
system.set("GitHub")
31-
url.set(project.properties["project_issues"].toString())
32-
}
33-
scm {
34-
url.set(project.properties["project_website"].toString())
35-
connection.set("scm:git:${project.properties["project_vcs"].toString()}")
36-
developerConnection.set("scm:git:${project.properties["project_vcs_git"].toString()}")
37-
}
38-
licenses {
39-
license {
40-
name.set("The MIT License (MIT)")
41-
url.set("http://www.opensource.org/licenses/mit-license.php")
42-
distribution.set("repo")
43-
}
44-
}
45-
developers {
46-
developer {
47-
id.set("Brutus5000")
48-
name.set("Brutus5000")
49-
organization {
50-
name.set("FAForever")
51-
url.set("https://github.com/FAForever")
52-
}
53-
}
54-
}
55-
}
56-
}
57-
}
58-
59-
repositories {
60-
maven {
61-
name = "MavenCentral"
62-
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
63-
credentials {
64-
username = project.properties["sonatypeUsername"].toString()
65-
password = project.properties["sonatypePassword"].toString()
66-
}
67-
}
68-
}
6919
}
7020
}

0 commit comments

Comments
 (0)