Upgrade to new gradle-nexus.publish-plugin
MODIFY
CHANGELOG.adoc
CHANGELOG.adoc
@@ -26,6 +26,7 @@ Bug Fixes::
Build Improvement::
* Use JavaCompile options.release instead of sourceCompatibility and targetCompatibility to target Java 8 (#1042)
+* Upgrade nexus publishing and staging to new gradle-nexus.publish-plugin (#1043)
== 2.5.1 (2021-05-04)

MODIFY
build.gradle
build.gradle
+import java.time.Duration
+
/*
adding the plugin jars to the classpath to apply them later.
currently the new plugins DSL does apply them directly.
@@ -21,14 +23,11 @@ buildscript {
plugins {
id "io.sdkman.vendors" version "2.0.0"
id "signing"
- id "io.codearte.nexus-staging" version "0.22.0"
- id "de.marcphilipp.nexus-publish" version "0.4.0"
+ id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'com.github.jruby-gradle.base' version '2.0.0'
id 'codenarc'
}
-apply plugin: 'io.codearte.nexus-staging'
-
// TIP use -PpublishRelease=true to active release behavior regardless of the version
status = project.hasProperty('publishRelease') && project.publishRelease.toBoolean() ?
'release' : ((version == 'unspecified' || version.endsWith('-SNAPSHOT')) ? 'snapshot' : 'release')
@@ -36,7 +35,9 @@ status = project.hasProperty('publishRelease') && project.publishRelease.toBoole
// using ExpandoMetaClass to add isDistribution() Method to Project instances...
Project.metaClass.isDistribution = { delegate.getName().endsWith("-distribution") }
-nexusStaging {
+nexusPublishing {
+ repositories {
+ sonatype {
if (project.hasProperty("sonatypeUsername")) {
username = project.sonatypeUsername
}
@@ -45,6 +46,9 @@ nexusStaging {
}
repositoryDescription = "Release ${project.group} ${project.version}"
}
+ }
+ clientTimeout = Duration.ofMinutes(5)
+}
ext {

MODIFY
gradle/publish.gradle
gradle/publish.gradle
-import java.time.Duration
-
-apply plugin: 'de.marcphilipp.nexus-publish'
+apply plugin: 'maven-publish'
publishing {
publications.create(project.ext.publicationName, MavenPublication) {
@@ -86,10 +84,4 @@ publishing {
}
}
-nexusPublishing {
- repositories {
- sonatype()
- }
- clientTimeout = Duration.ofMinutes(5)
-}

Upgrade to new gradle-nexus.publish-plugin