Skip to content

Commit c34a48b

Browse files
committed
Add nmcp plugin to replace old maven central publishing code
1 parent ebc9181 commit c34a48b

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
jacoco
44
`jacoco-report-aggregation`
55
alias(libs.plugins.sonarqube)
6+
id("com.gradleup.nmcp.aggregation")
67
}
78

89
allprojects {
@@ -30,6 +31,20 @@ dependencies {
3031
jacocoAggregation(project(":spring-webmvc-annotated-data-binder"))
3132
jacocoAggregation(project(":webflux-annotated-data-binder-spring-boot-starter"))
3233
jacocoAggregation(project(":webmvc-annotated-data-binder-spring-boot-starter"))
34+
35+
nmcpAggregation(project(":spring-annotated-data-binder-core"))
36+
nmcpAggregation(project(":spring-webflux-annotated-data-binder"))
37+
nmcpAggregation(project(":spring-webmvc-annotated-data-binder"))
38+
nmcpAggregation(project(":webflux-annotated-data-binder-spring-boot-starter"))
39+
nmcpAggregation(project(":webmvc-annotated-data-binder-spring-boot-starter"))
40+
}
41+
42+
nmcpAggregation {
43+
centralPortal {
44+
username = findProperty("sonatype.ossrh.username") as String?
45+
password = findProperty("sonatype.ossrh.password") as String?
46+
publishingType = "USER_MANAGED"
47+
}
3348
}
3449

3550
sonar {

buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ repositories {
1010
dependencies {
1111
implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.0.1")
1212
implementation("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1")
13+
implementation(libs.nmcpPlugin)
1314
}

buildSrc/src/main/kotlin/com/mattbertolini/buildlogic/maven-central-publish.gradle.kts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
java
55
`maven-publish`
66
signing
7+
id("com.gradleup.nmcp")
78
}
89

910
abstract class MavenCentralPublishExtension {
@@ -19,18 +20,6 @@ java {
1920
}
2021

2122
publishing {
22-
repositories {
23-
maven {
24-
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
25-
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
26-
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
27-
credentials {
28-
username = findProperty("sonatype.ossrh.username") as String?
29-
password = findProperty("sonatype.ossrh.password") as String?
30-
}
31-
}
32-
}
33-
3423
publications {
3524
register<MavenPublication>("mavenJava") {
3625
groupId = project.group as String

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ errorProneAnnotations = { module = "com.google.errorprone:error_prone_annotation
4141
nullAway = { module = "com.uber.nullaway:nullaway", version.ref = "nullAway" }
4242
nullAwayAnnotations = { module = "com.uber.nullaway:nullaway-annotations", version.ref = "nullAway" }
4343

44+
nmcpPlugin = { module = "com.gradleup.nmcp:nmcp", version = "1.0.2" }
45+
4446
[plugins]
4547
asciidoctorConvert = { id = "org.asciidoctor.jvm.convert", version = "3.3.2" }
4648
sonarqube = { id = "org.sonarqube", version = "5.0.0.4638" }

0 commit comments

Comments
 (0)