From 075ff7f1264570af5d04079b9fb8e83c12e30a7d Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Fri, 26 Nov 2021 09:54:06 +0100 Subject: [PATCH] Update build In general update the ancient build plugins around. Changes: * bring all maven plugins to latest versions * update checkstyle (as pre 8.41 is not supported anymore) * update checkstyle rules * make checkstyle plugin not fail the build (as there are issues) * fix maven-shade-plugin warnings about dupe resource * fix modernizer issue as it fails the build * make build reproducible Added comment about parent POM: the currently used parent is 10 years old, moreover, if you look in Maven Central, the GA is unmaintained (last release was in 2014). Better introduce own parent POM, or just copy whatever needed into this POM (related to staging) and stop using the ancient POM. --- pom.xml | 91 ++++++++++++++++--- .../java/org/gaul/s3proxy/S3ProxyHandler.java | 4 +- src/main/resources/checkstyle.xml | 6 +- 3 files changed, 81 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 5481849..ffcbcc5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,7 @@ 4.0.0 + org.sonatype.oss oss-parent @@ -53,7 +54,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.0.1 sign-artifacts @@ -73,8 +74,43 @@ org.apache.maven.plugins - maven-checkstyle-plugin + maven-enforcer-plugin 3.0.0 + + + enforce-maven + + enforce + + + + + 3.2.5 + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.2 check @@ -89,12 +125,26 @@ src/main/resources/copyright_header.txt true warning + + false + + + com.puppycrawl.tools + checkstyle + 9.1 + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.8.1 ${java.version} ${java.version} @@ -115,7 +165,7 @@ com.google.errorprone error_prone_core - 2.9.0 + 2.10.0 @@ -123,7 +173,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.0.2 + 3.2.0 @@ -136,7 +186,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 + 3.3.1 attach-javadocs @@ -149,7 +199,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.1.0 + 3.2.4 package @@ -158,6 +208,17 @@ false + + + org.eclipse.jetty:* + + META-INF/MANIFEST.MF + META-INF/LICENSE + META-INF/NOTICE.txt + about.html + + + org.eclipse.jetty:* @@ -176,7 +237,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.0.0 + 3.3.0 src/main/assembly/jar-with-dependencies.xml @@ -201,7 +262,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + 3.2.1 attach-sources @@ -246,7 +307,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.2.0 + 4.4.2 com.github.spotbugs @@ -269,7 +330,7 @@ org.skife.maven really-executable-jar-maven-plugin - 1.4.1 + 1.5.0 s3proxy @@ -285,7 +346,7 @@ org.gaul modernizer-maven-plugin - 2.1.0 + 2.3.0 modernizer @@ -302,7 +363,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.5 + 1.6.8 true ossrh @@ -319,7 +380,9 @@ 2.4.0 1.7.28 ${project.groupId}.shaded - 2.20 + 2.22.2 + + 2021-11-26T09:00:00Z diff --git a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java index ffdf6f1..8b7c8ca 100644 --- a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java +++ b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java @@ -68,8 +68,8 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; import com.google.common.collect.Maps; +import com.google.common.collect.Streams; import com.google.common.escape.Escaper; import com.google.common.hash.HashCode; import com.google.common.hash.HashFunction; @@ -1472,7 +1472,7 @@ public class S3ProxyHandler { isListV2 ? "NextContinuationToken" : "NextMarker", encodeBlob(encodingType, nextMarker)); if (Quirks.OPAQUE_MARKERS.contains(blobStoreType)) { - StorageMetadata sm = Iterables.getLast(set, null); + StorageMetadata sm = Streams.findLast(set.stream()).orElse(null); if (sm != null) { lastKeyToMarker.put(Maps.immutableEntry(containerName, sm.getName()), nextMarker); diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 8ffd88f..6eb74f8 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -9,10 +9,10 @@ - + - + @@ -38,7 +38,6 @@ -