From ae4f32f3e67bdfbb637e218fd2be73e76d99ff48 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:13:34 -0500 Subject: [PATCH 1/9] bump gradle version to support java 17 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c072774..b3cb6c9e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,6 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 1068aeb5c8d6368f34ae92f2d1557a34863e5375 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:14:45 -0500 Subject: [PATCH 2/9] change groupId for publishing to maven central --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 04db9e48..14b08397 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ repositories { mavenCentral() } -group = 'software.amazon.nio.s3' +group = 'com.sigpwned' archivesBaseName = 'nio-spi-for-s3' version = '1.1.0' From 128f94928997e9233efebf881037f4aa7b24eee2 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:15:01 -0500 Subject: [PATCH 3/9] add gradle.properties to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4f2134b0..798f0816 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .gradle .idea gradle +gradle.properties # Ignore Gradle build output directory build From 5cd20820689000aab98f81683f2a2a14b0c69d9a Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:26:02 -0500 Subject: [PATCH 4/9] prepare for release to maven central --- build.gradle | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/build.gradle b/build.gradle index 14b08397..44d8c5c5 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ plugins { id 'maven-publish' id 'jacoco' id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.bmuschko.nexus' } repositories { @@ -86,3 +87,51 @@ jacocoTestReport { xml.outputLocation = file("build/reports/coverage.xml") } } + +modifyPom { + project { + name 'nio-spi-for-s3' + description 'AWS Java NIO SPI for S3' + url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3' + inceptionYear '2022' + + scm { + url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main' + connection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + developerConnection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + } + + licenses { + license { + name 'Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + + developers { + developer { + id 'markjschreiber' + name 'Mark Schreiber' + email 'markjschreiber@gmail.com' + } + developer { + id 'sigpwned' + name 'Andy Boothe' + email 'andy@sigpwned.com' + } + } + } +} + +extraArchive { + sources = true + tests = true + javadoc = true +} + +nexus { + sign = true + repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' + snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' +} From 9df51a75345d3dfdc3d5ba85f8cfbf02b803d2db Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:37:21 -0500 Subject: [PATCH 5/9] prepare for release to maven central --- build.gradle | 91 +++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/build.gradle b/build.gradle index 44d8c5c5..dd088dcd 100644 --- a/build.gradle +++ b/build.gradle @@ -12,9 +12,11 @@ plugins { id 'maven-publish' id 'jacoco' id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'com.bmuschko.nexus' + id 'io.codearte.nexus-staging' version '0.11.0' } +apply plugin: 'com.bmuschko.nexus' + repositories { // Use Maven Central for resolving dependencies. mavenCentral() @@ -56,22 +58,51 @@ dependencies { publishing { publications { - s3fsSpiLibrary(MavenPublication) { + maven(MavenPublication) { from components.java pom { name = 'AWS Java NIO SPI for S3' description = 'A Java NIO.2 service provider for S3, allowing Java NIO operations to be performed on paths using the `s3` scheme. This\n' + 'package implements the service provider interface (SPI) defined for Java NIO.2 in JDK 1.7 providing "plug-in" non-blocking\n' + 'access to S3 objects for Java applications using Java NIO.2 for file access.' - url = 'https://github.com/awslabs/aws-java-nio-spi-for-s3' + url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3' + inceptionYear '2022' + + scm { + url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main' + connection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + developerConnection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + } + licenses { license { - name = 'The Apache License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + name 'Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + + developers { + developer { + id 'markjschreiber' + name 'Mark Schreiber' + email 'markjschreiber@gmail.com' + } + developer { + id 'sigpwned' + name 'Andy Boothe' + email 'andy@sigpwned.com' } } } + } + } + repositories { + maven { + def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' + def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl } } } @@ -88,50 +119,16 @@ jacocoTestReport { } } -modifyPom { - project { - name 'nio-spi-for-s3' - description 'AWS Java NIO SPI for S3' - url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3' - inceptionYear '2022' - - scm { - url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main' - connection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' - developerConnection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' - } - - licenses { - license { - name 'Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' - } - } +signing { + sign publishing.publications.mavenJava +} - developers { - developer { - id 'markjschreiber' - name 'Mark Schreiber' - email 'markjschreiber@gmail.com' - } - developer { - id 'sigpwned' - name 'Andy Boothe' - email 'andy@sigpwned.com' - } - } +javadoc { + if(JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) } } -extraArchive { - sources = true - tests = true - javadoc = true -} -nexus { - sign = true - repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' - snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' -} + + From c71bf50cac50e5ccd3383a2e413e0fd1b7d0b844 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:37:51 -0500 Subject: [PATCH 6/9] remove unneeded build plugin --- build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index dd088dcd..78c96c7c 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,6 @@ plugins { id 'io.codearte.nexus-staging' version '0.11.0' } -apply plugin: 'com.bmuschko.nexus' - repositories { // Use Maven Central for resolving dependencies. mavenCentral() From b145a7ef21d814c7bff35f3a17944f640219ab70 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:49:28 -0500 Subject: [PATCH 7/9] prepare to publish to maven central --- build.gradle | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 78c96c7c..f26f1d0e 100644 --- a/build.gradle +++ b/build.gradle @@ -10,9 +10,9 @@ plugins { // Apply the java-library plugin for API and implementation separation. id 'java-library' id 'maven-publish' + id 'signing' id 'jacoco' id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'io.codearte.nexus-staging' version '0.11.0' } repositories { @@ -63,33 +63,33 @@ publishing { description = 'A Java NIO.2 service provider for S3, allowing Java NIO operations to be performed on paths using the `s3` scheme. This\n' + 'package implements the service provider interface (SPI) defined for Java NIO.2 in JDK 1.7 providing "plug-in" non-blocking\n' + 'access to S3 objects for Java applications using Java NIO.2 for file access.' - url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3' - inceptionYear '2022' + url = 'https://github.com/sigpwned/aws-java-nio-spi-for-s3' + inceptionYear = '2022' scm { - url 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main' - connection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' - developerConnection 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + url = 'https://github.com/sigpwned/aws-java-nio-spi-for-s3/tree/main' + connection = 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' + developerConnection = 'scm:git:ssh://git@github.com/sigpwned/aws-java-nio-spi-for-s3.git' } licenses { license { - name 'Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = 'Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' } } developers { developer { - id 'markjschreiber' - name 'Mark Schreiber' - email 'markjschreiber@gmail.com' + id = 'markjschreiber' + name = 'Mark Schreiber' + email = 'markjschreiber@gmail.com' } developer { - id 'sigpwned' - name 'Andy Boothe' - email 'andy@sigpwned.com' + id = 'sigpwned' + name = 'Andy Boothe' + email = 'andy@sigpwned.com' } } } @@ -118,7 +118,7 @@ jacocoTestReport { } signing { - sign publishing.publications.mavenJava + sign publishing.publications.maven } javadoc { From 5c90eea53a7681cff9b2c7119e0b7106aa6e84b5 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 10:53:07 -0500 Subject: [PATCH 8/9] prepare for publish to maven central --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index f26f1d0e..79751eef 100644 --- a/build.gradle +++ b/build.gradle @@ -101,6 +101,7 @@ publishing { def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + credentials(PasswordCredentials) } } } From f8f8ca2cc50a7ef115a5491c6285ad6f34021709 Mon Sep 17 00:00:00 2001 From: Andy Boothe Date: Wed, 5 Oct 2022 11:07:16 -0500 Subject: [PATCH 9/9] add example gradle properties to show structure --- gradle.properties.example | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 gradle.properties.example diff --git a/gradle.properties.example b/gradle.properties.example new file mode 100644 index 00000000..4e22412e --- /dev/null +++ b/gradle.properties.example @@ -0,0 +1,9 @@ +# Probably a usertoken from Maven Central +mavenUsername= +mavenPassword= + +signing.keyId= +signing.password= +# Generated using: $ gpg --keyring secring.gpg --export-secret-keys > /path/to/home/.gnupg/secring.gpg +signing.secretKeyRingFile=/path/to/home/.gnupg/secring.gpg +