update to new nexus publishing plugin, bump to v1.7.3

This commit is contained in:
Craig Raw 2024-01-10 10:59:11 +02:00
parent 9f1a444c90
commit eb245e005a
2 changed files with 48 additions and 52 deletions

View file

@ -12,7 +12,7 @@ Hummingbird requires a minimum of Java 8.
Hummingbird is hosted in Maven Central and can be added as a dependency with the following: Hummingbird is hosted in Maven Central and can be added as a dependency with the following:
``` ```
implementation('com.sparrowwallet:hummingbird:1.7.2') implementation('com.sparrowwallet:hummingbird:1.7.3')
``` ```
## Usage ## Usage

View file

@ -1,22 +1,13 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
plugins { plugins {
id 'java-library' id 'java-library'
id 'io.codearte.nexus-staging' version '0.22.0' id 'maven-publish'
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
} }
apply plugin: 'com.bmuschko.nexus'
archivesBaseName = 'hummingbird' archivesBaseName = 'hummingbird'
group 'com.sparrowwallet' group 'com.sparrowwallet'
version '1.7.2' version '1.7.3'
repositories { repositories {
mavenCentral() mavenCentral()
@ -27,57 +18,62 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'junit', name: 'junit', version: '4.12'
} }
java {
withJavadocJar()
withSourcesJar()
}
jar { jar {
manifest { manifest {
attributes 'Automatic-Module-Name' : 'com.sparrowwallet.hummingbird' attributes 'Automatic-Module-Name' : 'com.sparrowwallet.hummingbird'
} }
} }
modifyPom { publishing {
project { publications {
name 'hummingbird' mavenJava(MavenPublication) {
description 'Java implementation of Uniform Resources (UR)' from(components.java)
url 'https://github.com/sparrowwallet/hummingbird'
inceptionYear '2020'
scm {
url 'https://github.com/sparrowwallet/hummingbird'
connection 'scm:https://github.com/sparrowwallet/hummingbird.git'
developerConnection 'scm:git@github.com:sparrowwallet/hummingbird.git'
}
pom {
name.set("hummingbird")
description.set("Java implementation of Uniform Resources (UR)")
url.set("https://github.com/sparrowwallet/hummingbird")
licenses { licenses {
license { license {
name 'The Apache Software License, Version 2.0' name.set("The Apache Software License, Version 2.0")
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution 'repo'
} }
} }
developers { developers {
developer { developer {
id 'craigraw' id.set("craigraw")
name 'Craig Raw' name.set("Craig Raw")
email 'mail@sparrowwallet.com' email.set("mail@sparrowwallet.com")
}
}
scm {
connection.set("scm:https://github.com/sparrowwallet/hummingbird.git")
developerConnection.set("scm:git@github.com:sparrowwallet/hummingbird.git")
url.set("https://github.com/sparrowwallet/hummingbird")
}
} }
} }
} }
} }
extraArchive { nexusPublishing {
sources = true packageGroup = "com.sparrowwallet.hummingbird"
tests = true repositories {
javadoc = true sonatype {
stagingProfileId = "a63b4b5e2bff9"
username = project.findProperty("nexusUsername")
password = project.findProperty("nexusPassword")
}
}
} }
nexus { signing {
sign = true sign publishing.publications.mavenJava
repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
} }
nexusStaging { /* ./gradlew publishToSonatype closeAndReleaseStagingRepository */
}
/* See https://www.albertgao.xyz/2018/01/18/how-to-publish-artifact-to-maven-central-via-gradle/ */