Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Commit 95aa174

Browse files
committed
(feat.) 修复构建脚本无法将jar上传maven central (03)
1 parent c8b7518 commit 95aa174

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

build.gradle.kts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
plugins {
2-
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
3-
}
4-
51
subprojects {
62
apply(plugin = "java-library")
73
apply(plugin = "signing")
@@ -29,6 +25,17 @@ subprojects {
2925
withSourcesJar()
3026
}
3127

28+
extensions.configure<PublishingExtension> {
29+
repositories {
30+
maven("https://ossrh-staging-api.central.sonatype.com/service/local/") {
31+
credentials {
32+
username = System.getenv("MAVEN_USERNAME")
33+
password = System.getenv("MAVEN_PASSWORD")
34+
}
35+
}
36+
}
37+
}
38+
3239
extensions.configure<SigningExtension> {
3340
useInMemoryPgpKeys(
3441
System.getenv("SECRET_KEY"),
@@ -39,15 +46,3 @@ subprojects {
3946
.forEach(::sign) /* Sign Maven Jar */
4047
}
4148
}
42-
43-
nexusPublishing {
44-
repositories {
45-
sonatype {
46-
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
47-
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
48-
49-
username.set(System.getenv("MAVEN_USERNAME"))
50-
password.set(System.getenv("MAVEN_PASSWORD"))
51-
}
52-
}
53-
}

0 commit comments

Comments
 (0)