From 3a2122b99f1b8856dde508e34f92c96d6b051702 Mon Sep 17 00:00:00 2001 From: Ali Ahmed Date: Tue, 17 Dec 2019 20:04:45 -0800 Subject: [PATCH] Fix pulsar build image with maven 3.6.1 (#5886) --- build/docker/Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index bcb17c0b19abd..9ae75f530e9d8 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /pulsar ADD protobuf.patch /pulsar RUN apt-get update && \ - apt-get install -y maven tig g++ cmake libssl-dev libcurl4-openssl-dev \ + apt-get install -y tig g++ cmake libssl-dev libcurl4-openssl-dev \ liblog4cxx-dev libprotobuf-dev libboost-all-dev google-mock libgtest-dev \ libjsoncpp-dev libxml2-utils protobuf-compiler wget \ curl doxygen openjdk-8-jdk-headless clang-format-5.0 \ @@ -78,3 +78,16 @@ RUN git clone https://github.com/google/protobuf.git /pulsar/protobuf && \ autoreconf --install && \ ./configure && \ make + +# Installation +ARG MAVEN_FILENAME="apache-maven-${MAVEN_VERSION}-bin.tar.gz" +ARG MAVEN_URL="http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_FILENAME}" +ARG MAVEN_TMP="/tmp/${MAVEN_FILENAME}" +RUN wget --no-verbose -O ${MAVEN_TMP} ${MAVEN_URL} + +# Cleanup +RUN tar xzf ${MAVEN_TMP} -C /opt/ \ + && ln -s /opt/apache-maven-${MAVEN_VERSION} ${MAVEN_HOME} \ + && ln -s ${MAVEN_HOME}/bin/mvn /usr/local/bin + +RUN unset MAVEN_VERSION