You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by rs...@apache.org on 2020/11/30 13:04:05 UTC

[avro] branch master updated: AVRO-2994: Maven 3.6.3 from Apache servers. (#1028)

This is an automated email from the ASF dual-hosted git repository.

rskraba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 2cc44c5  AVRO-2994: Maven 3.6.3 from Apache servers. (#1028)
2cc44c5 is described below

commit 2cc44c5b3ab234ac1258a34d233a9d88cfe15565
Author: RyanSkraba <ry...@skraba.com>
AuthorDate: Mon Nov 30 14:03:53 2020 +0100

    AVRO-2994: Maven 3.6.3 from Apache servers. (#1028)
---
 share/docker/Dockerfile | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index bfcab76..4ad3c76 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -49,7 +49,6 @@ RUN apt-get -qqy update \
                                                  libsnappy-dev \
                                                  libsnappy1v5 \
                                                  make \
-                                                 maven \
                                                  mypy \
                                                  openjdk-8-jdk \
                                                  perl \
@@ -68,6 +67,36 @@ RUN apt-get -qqy update \
  && apt-get -qqy clean \
  && rm -rf /var/lib/apt/lists
 
+# Install a maven release  -------------------------------------------
+# Inspired from https://github.com/apache/accumulo-docker/blob/master/Dockerfile#L53
+
+ENV MAVEN_VERSION 3.6.3
+ENV APACHE_DIST_URLS \
+  https://www.apache.org/dyn/closer.cgi?action=download&filename= \
+  # if the version is outdated (or we're grabbing the .asc file), we might have to pull from the dist/archive :/
+  https://www-us.apache.org/dist/ \
+  https://www.apache.org/dist/ \
+  https://archive.apache.org/dist/
+RUN set -eux; \
+  download() { \
+    local f="$1"; shift; \
+    local distFile="$1"; shift; \
+    local success=; \
+    local distUrl=; \
+    for distUrl in $APACHE_DIST_URLS; do \
+      if wget -nv -O "$f" "$distUrl$distFile"; then \
+        success=1; \
+        break; \
+      fi; \
+    done; \
+    [ -n "$success" ]; \
+  }; \
+  download "maven.tar.gz" "maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz"; \
+  tar xzf "maven.tar.gz" -C /tmp/; \
+  mv /tmp/apache-maven-$MAVEN_VERSION /opt/maven; \
+  rm "maven.tar.gz"
+ENV PATH="/opt/maven/bin:${PATH}"
+
 # Install nodejs 6
 RUN curl -sSL https://deb.nodesource.com/setup_10.x \
   | bash - \