Skip to content

Commit

Permalink
Upgrade to latest maven version and use sdkman to install it (#777)
Browse files Browse the repository at this point in the history
Motivation:

There was a new maven release we should use. Also just use sdkman to do so.

Modifications:

- Upgrade to maven 3.9.1
- Use sdkman

Result:

Use latest maven version and use sdkman
  • Loading branch information
normanmaurer committed Mar 29, 2023
1 parent 7627580 commit 7ea4a1d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://maven-central.storage-download.googleapis.com/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
distributionUrl=https://maven-central.storage-download.googleapis.com/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
8 changes: 3 additions & 5 deletions docker/Dockerfile.centos6
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV CMAKE_VERSION_BASE 3.8
ENV CMAKE_VERSION $CMAKE_VERSION_BASE.2
ENV NINJA_VERSION 1.7.2
ENV GO_VERSION 1.9.3
ENV MAVEN_VERSION 3.9.1

# Update as we need to use the vault now.
RUN sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\//baseurl=https:\/\/linuxsoft.cern.ch\/centos-vault\/\/6.10\//g' /etc/yum.repos.d/CentOS-Base.repo
Expand Down Expand Up @@ -54,18 +55,15 @@ ENV JAVA_VERSION $java_version
# Installing Java removing some unnecessary SDKMAN files
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
yes | sdk install java $JAVA_VERSION && \
yes | sdk install maven $MAVEN_VERSION && \
rm -rf $HOME/.sdkman/archives/* && \
rm -rf $HOME/.sdkman/tmp/*"

RUN echo 'export JAVA_HOME="/root/.sdkman/candidates/java/current"' >> ~/.bashrc
RUN echo 'PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc

WORKDIR /opt
RUN curl https://downloads.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz | tar -xz
RUN echo 'PATH=/opt/apache-maven-3.8.7/bin/:$PATH' >> ~/.bashrc

# Prepare our own build
ENV PATH /opt/apache-maven-3.8.7/bin/:$PATH
ENV PATH /root/.sdkman/candidates/maven/current:$PATH
ENV JAVA_HOME /jdk/

# This is workaround to be able to compile boringssl with -DOPENSSL_C11_ATOMIC as while we use a recent gcc installation it still needs some
Expand Down
16 changes: 11 additions & 5 deletions docker/Dockerfile.cross_compile_aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ ARG openssl_version=1_1_1d
ENV SOURCE_DIR /root/source
ENV GCC_VERSION $gcc_version
ENV OPENSSL_VERSION $openssl_version
ENV MAVEN_VERSION 3.9.1

# We want to have git 2.x for the maven scm plugin and also for boringssl
RUN yum install -y http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm

# Install requirements
RUN set -x && \
yum -y install epel-release && \
yum -y install wget tar git make autoconf automake libtool openssl-devel ninja-build gcc-c++ patch
yum -y install wget tar git make autoconf automake libtool openssl-devel ninja-build gcc-c++ patch unzip zip

# Install Java
RUN yum install -y java-1.8.0-openjdk-devel golang
Expand All @@ -36,9 +37,14 @@ RUN set -x && \
make && make install && \
popd

WORKDIR /opt
RUN curl https://downloads.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz | tar -xz
RUN echo 'PATH=/opt/apache-maven-3.8.7/bin/:$PATH' >> ~/.bashrc
# Downloading and installing SDKMAN!
RUN curl -s "https://get.sdkman.io" | bash

# Installing Java and Maven, removing some unnecessary SDKMAN files
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
yes | sdk install maven $MAVEN_VERSION && \
rm -rf $HOME/.sdkman/archives/* && \
rm -rf $HOME/.sdkman/tmp/*"

# Prepare our own build
ENV PATH /opt/apache-maven-3.8.7/bin/:$PATH
ENV PATH /root/.sdkman/candidates/maven/current:$PATH
5 changes: 0 additions & 5 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,5 @@ RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \
RUN echo 'export JAVA_HOME="/root/.sdkman/candidates/java/current"' >> ~/.bashrc
RUN echo 'PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc

WORKDIR /opt
RUN curl https://downloads.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz | tar -xz
RUN echo 'PATH=/opt/apache-maven-3.8.7/bin/:$PATH' >> ~/.bashrc

# Prepare our own build
ENV PATH /opt/apache-maven-3.8.7/bin/:$PATH
ENV JAVA_HOME /jdk/
10 changes: 5 additions & 5 deletions docker/docker-compose.centos-6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ services:

build-clean:
<<: *common
command: /bin/bash -cl "mvn clean package"
command: /bin/bash -cl "./mvnw clean package"

build:
<<: *common
command: /bin/bash -cl "mvn clean package"
command: /bin/bash -cl "./mvnw clean package"

stage-snapshot:
<<: *common
Expand All @@ -39,7 +39,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "mvn -Pstage -am -pl openssl-dynamic,boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
command: /bin/bash -cl "./mvnw -Pstage -am -pl openssl-dynamic,boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"

stage-release:
<<: *common
Expand All @@ -49,7 +49,7 @@ services:
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pstage -am -pl openssl-dynamic,boringssl-static clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Pstage -am -pl openssl-dynamic,boringssl-static clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"

deploy:
<<: *common
Expand All @@ -59,7 +59,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "mvn clean deploy -DskipTests=true"
command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true"

shell:
<<: *common
Expand Down
8 changes: 4 additions & 4 deletions docker/docker-compose.centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:

cross-compile-aarch64-build:
<<: *cross-compile-aarch64-common
command: /bin/bash -cl "mvn clean package -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share -DskipTests && mvn clean package -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DskipTests"
command: /bin/bash -cl "./mvnw clean package -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share -DskipTests && ./mvnw clean package -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DskipTests"

cross-compile-aarch64-deploy:
<<: *cross-compile-aarch64-common
Expand All @@ -49,7 +49,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "mvn clean deploy -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share -DskipTests && mvn clean deploy -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DskipTests"
command: /bin/bash -cl "./mvnw clean deploy -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share -DskipTests && ./mvnw clean deploy -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DskipTests"

cross-compile-aarch64-stage-snapshot:
<<: *cross-compile-aarch64-common
Expand All @@ -59,7 +59,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "mvn -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true && mvn -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
command: /bin/bash -cl "./mvnw -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true && ./mvnw -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"

cross-compile-aarch64-stage-release:
<<: *cross-compile-aarch64-common
Expand All @@ -69,4 +69,4 @@ services:
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME} && mvn -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -Plinux-aarch64 -am -pl openssl-dynamic -DopensslArmHome=/opt/openssl-$$OPENSSL_VERSION-share clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME} && ./mvnw -Plinux-aarch64 -am -pl boringssl-static -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
10 changes: 5 additions & 5 deletions docker/docker-compose.debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:

build:
<<: *common
command: /bin/bash -cl "mvn clean package"
command: /bin/bash -cl "./mvnw clean package"

deploy-dynamic-only:
<<: *common
Expand All @@ -35,11 +35,11 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "mvn -am -pl openssl-dynamic clean deploy -DskipTests=true"
command: /bin/bash -cl "./mvnw -am -pl openssl-dynamic clean deploy -DskipTests=true"

build-dynamic-only:
<<: *common
command: /bin/bash -cl "mvn -am -pl openssl-dynamic clean package"
command: /bin/bash -cl "./mvnw -am -pl openssl-dynamic clean package"

stage-snapshot:
<<: *common
Expand All @@ -49,7 +49,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "mvn -Pstage -am -pl openssl-dynamic clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
command: /bin/bash -cl "./mvnw -Pstage -am -pl openssl-dynamic clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"

stage-release:
<<: *common
Expand All @@ -63,7 +63,7 @@ services:
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pstage -am -pl openssl-dynamic clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Pstage -am -pl openssl-dynamic clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"

shell:
<<: *common
Expand Down

0 comments on commit 7ea4a1d

Please sign in to comment.