Skip to content

Commit b662f4d

Browse files
Sheikah45Brutus5000
authored andcommitted
Use other plugin
1 parent a12989f commit b662f4d

2 files changed

Lines changed: 55 additions & 50 deletions

File tree

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
@@ -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+
}

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)