Light, fluffy, and always free - The AWS Local Emulator alternative
build: verify Maven distribution checksums (#4751)
Niels Kootstra02eb4e7297f6
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.propertiesindex 216df05897..a3c407ffc2 100644--- a/.mvn/wrapper/maven-wrapper.properties+++ b/.mvn/wrapper/maven-wrapper.properties@@ -1,3 +1,4 @@wrapperVersion=3.3.4distributionType=only-scriptdistributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip+distributionSha256Sum=5af3b743dd8b876b5c45da33b676251e5f1687712644abb4ee519ca56e1d89cediff --git a/docker/Dockerfile.native b/docker/Dockerfile.nativeindex 3f7d257b68..db3f3d5fe2 100644--- a/docker/Dockerfile.native+++ b/docker/Dockerfile.native@@ -4,7 +4,11 @@ USER rootWORKDIR /app# Install Maven 3.9.x (system Maven is too old for Quarkus 3.31)-RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz | tar xz -C /opt \+# The SHA-512 is Apache's published checksum for apache-maven-3.9.12-bin.tar.gz.+RUN curl -fsSL -o /tmp/maven.tar.gz https://archive.apache.org/dist/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz \+ && echo "0a1be79f02466533fc1a80abbef8796e4f737c46c6574ede5658b110899942a94db634477dfd3745501c80aef9aac0d4f841d38574373f7e2d24cce89d694f70 /tmp/maven.tar.gz" | sha512sum -c - \+ && tar xzf /tmp/maven.tar.gz -C /opt \+ && rm /tmp/maven.tar.gz \&& ln -sf /opt/apache-maven-3.9.12/bin/mvn /usr/local/bin/mvnCOPY pom.xml .diff --git a/mvnw b/mvnwindex bd8896bf22..7b2fade6fb 100755--- a/mvnw+++ b/mvnw@@ -177,6 +177,8 @@ verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"# select .zip or .tar.gzif ! command -v unzip >/dev/null; then+ # distributionSha256Sum is the checksum of the .zip, so the .tar.gz fallback cannot be verified+ [ -z "${distributionSha256Sum-}" ] || die "unzip is required to install Maven because distributionSha256Sum is set in maven-wrapper.properties. Please install unzip."distributionUrl="${distributionUrl%.zip}.tar.gz"distributionUrlName="${distributionUrl##*/}"fi