Skip to content

Commit c7d7dc5

Browse files
authored
Automatically fetch & use the latest Maven 3 patch version for Docker builds/publish workflow (#204)
1 parent 38860c4 commit c7d7dc5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ RUN apt-get update && apt-get install -y openssh-server vim python3 --no-install
1717
rm -rf /var/lib/apt/lists/* && \
1818
service ssh start
1919

20-
COPY scripts/get-latest-maven-version.sh ./get-latest-maven-version.sh
21-
RUN chmod +x ./get-latest-maven-version.sh
22-
2320
# Copy CDM jar & template files
24-
ARG MAVEN_VERSION=$(./get-latest-maven-version.sh)
2521
ARG USER_HOME_DIR="/root"
26-
ARG BASE_URL=https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
2722
ENV MAVEN_HOME /usr/share/maven
2823
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
2924
COPY ./src /assets/src
@@ -32,8 +27,12 @@ COPY ./src/resources/cdm.properties /assets/
3227
COPY ./src/resources/cdm-detailed.properties /assets/
3328
COPY ./src/resources/partitions.csv /assets/
3429
COPY ./src/resources/primary_key_rows.csv /assets/
30+
COPY scripts/get-latest-maven-version.sh ./get-latest-maven-version.sh
3531

36-
RUN mkdir -p /usr/share/maven /usr/share/maven/ref && \
32+
RUN chmod +x ./get-latest-maven-version.sh && \
33+
export MAVEN_VERSION=$(./get-latest-maven-version.sh) && \
34+
export BASE_URL=https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries && \
35+
mkdir -p /usr/share/maven /usr/share/maven/ref && \
3736
curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
3837
tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && \
3938
rm -f /tmp/apache-maven.tar.gz && \

0 commit comments

Comments
 (0)