@@ -45,6 +45,7 @@ plugins {
45
45
id ' java'
46
46
id ' maven-publish'
47
47
id ' signing'
48
+ id(" com.gradleup.nmcp" ). version(" 0.1.4" ) // https://github.com/GradleUp/nmcp
48
49
}
49
50
50
51
repositories {
@@ -71,7 +72,7 @@ repositories {
71
72
72
73
group = " org.labkey.api"
73
74
74
- version = " 6.3 .0-SNAPSHOT"
75
+ version = " 6.4 .0-SNAPSHOT"
75
76
76
77
dependencies {
77
78
api " org.json:json:${ jsonObjectVersion} "
@@ -196,17 +197,6 @@ project.publishing {
196
197
}
197
198
}
198
199
repositories {
199
- if (project. hasProperty(" sonatype_staging_url" ) && project. hasProperty(" sonatype_username" ) && project. hasProperty(" sonatype_password" ))
200
- {
201
- maven {
202
- url = sonatype_staging_url
203
- credentials {
204
- username = sonatype_username
205
- password = sonatype_password
206
- }
207
- }
208
- }
209
-
210
200
if (project. hasProperty(' artifactory_user' ) && project. hasProperty(' artifactory_password' ))
211
201
{
212
202
maven {
@@ -242,3 +232,28 @@ if (project.hasProperty("signing.keyId") && project.hasProperty("signing.passwor
242
232
}
243
233
}
244
234
235
+ if (project. hasProperty(" sonatype_username" ) && project. hasProperty(" sonatype_password" ))
236
+ {
237
+ // Plugin that uses the New Maven Central Publishing (NMCP) API to publish Maven artifacts. https://github.com/GradleUp/nmcp
238
+ nmcp {
239
+ centralPortal {
240
+ username = sonatype_username
241
+ password = sonatype_password
242
+ // publish manually from the portal
243
+ publishingType = " USER_MANAGED"
244
+ // // or if you want to publish automatically
245
+ // publishingType = "AUTOMATIC"
246
+ }
247
+ }
248
+ }
249
+
250
+ project. tasks. register(' publishRelease' , DefaultTask ) {
251
+ DefaultTask task ->
252
+ task. group = ' Publishing'
253
+ task. description = ' Publish to Local repository and Maven Central'
254
+ if (project. hasProperty(" artifactory_user" ) && project. hasProperty(" artifactory_password" ))
255
+ task. dependsOn(tasks. publish)
256
+ if (project. hasProperty(" sonatype_username" ) && project. hasProperty(" sonatype_password" ))
257
+ task. dependsOn(tasks. publishLibsPublicationToCentralPortal)
258
+ }
259
+
0 commit comments