Skip to content

Commit c1ede52

Browse files
committed
Use new plugin for publishing using new Maven Central API
1 parent ffdc19d commit c1ede52

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# The LabKey Remote API Library for Java - Change Log
22

3-
## version 6.3.0-SNAPSHOT
3+
## version 6.3.0
44
*Released*: TBD
55
* Update Commons Codec, Commons Logging, Gradle, Gradle Plugins, HttpClient, HttpCore, and JSONObject versions
66
* Remove defunct FileNotification API and uses
7+
* Update publishing method for new Maven Central API
78

89
## version 6.2.0
910
*Released*: 29 July 2024

build.gradle

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ plugins {
4545
id 'java'
4646
id 'maven-publish'
4747
id 'signing'
48+
id("com.gradleup.nmcp").version("0.1.4") // https://github.com/GradleUp/nmcp
4849
}
4950

5051
repositories {
@@ -196,17 +197,6 @@ project.publishing {
196197
}
197198
}
198199
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-
210200
if (project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password'))
211201
{
212202
maven {
@@ -242,3 +232,22 @@ if (project.hasProperty("signing.keyId") && project.hasProperty("signing.passwor
242232
}
243233
}
244234

235+
// Plugin that uses the New Maven Central Publishing (NMCP) API to publish Maven artifacts. https://github.com/GradleUp/nmcp
236+
nmcp {
237+
centralPortal {
238+
username = sonatype_username
239+
password = sonatype_password
240+
// publish manually from the portal
241+
publishingType = "USER_MANAGED"
242+
// // or if you want to publish automatically
243+
// publishingType = "AUTOMATIC"
244+
}
245+
}
246+
247+
project.tasks.register('publishRelease', DefaultTask) {
248+
DefaultTask task ->
249+
task.group = 'Publishing'
250+
task.description = 'Publish to Local repository and Maven Central'
251+
task.dependsOn(tasks.publish, tasks.publishLibsPublicationToCentralPortal)
252+
}
253+

0 commit comments

Comments
 (0)