From 88c24d60078a454ef4a85f57ec499f3bf1d67c3a Mon Sep 17 00:00:00 2001 From: Vincent Massol Date: Wed, 13 Mar 2024 16:24:20 +0100 Subject: [PATCH] [Misc] Remove java 7 + update java 17 installation to be simpler (and fix the fact that for some reason it wasn't working anymore) --- build/Dockerfile | 27 ++++++--------------------- build/README.md | 1 - 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index ae5b609..68d633b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -82,30 +82,17 @@ RUN apt-get --no-install-recommends -y install libasound2 && \ WORKDIR /root -# Add Zulu repository to install Java7 -# TODO: Remove once we don't have any Contrib extension using a minimum version of XWiki supporting Java 7. -# Instructions from https://docs.azul.com/zulu/zuludocs/#ZuluUserGuide/PrepareZuluPlatform/AttachAPTRepositoryUbuntuOrDebianSys.htm -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9 -RUN echo 'deb https://repos.azulsystems.com/debian stable main' > /etc/apt/sources.list.d/zulu.list -RUN apt-get update && \ - apt-get --no-install-recommends -y install zulu-7 - # Install Java 8 # TODO: Remove once we don't have any Contrib extension using a minimum version of XWiki supporting Java 8. -RUN wget --no-verbose -O /usr/lib/jvm/java8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz && \ +RUN mkdir -p /usr/lib/jvm && \ + wget --no-verbose -O /usr/lib/jvm/java8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz && \ tar -C /usr/lib/jvm -xzf /usr/lib/jvm/java8.tar.gz && \ rm /usr/lib/jvm/java8.tar.gz # Install Java 17 -# Needed for Sonarcloud now requiring Java 17. -# TODO: Remove `-o "Acquire::https::Verify-Peer=false"` once the following errors are fixed: -# Err:8 https://repos.azul.com/zulu/deb stable Release -# Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. -# Could not handshake: Error in the certificate verification. [IP: 104.18.0.192 443] -# Reading package lists... -# E: The repository 'https://repos.azul.com/zulu/deb stable Release' does not have a Release file. -RUN apt-get -o "Acquire::https::Verify-Peer=false" update && \ - apt-get -o "Acquire::https::Verify-Peer=false" --no-install-recommends -y install zulu17-jdk +RUN wget --no-verbose -O /usr/lib/jvm/java17.deb https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.deb && \ + apt install /usr/lib/jvm/java17.deb && \ + rm /usr/lib/jvm/java17.deb # Copy VNC config files COPY vnc/.Xauthority .Xauthority @@ -130,15 +117,13 @@ RUN wget --no-check-certificate https://archive.apache.org/dist/maven/maven-3/$M # - Java17 to be available at /home/hudsonagent/java17 # - Java11 to be available at /home/hudsonagent/java11 # - Java8 to be available at /home/hudsonagent/java8 -# - Java7 to be available at /home/hudsonagent/java7 # - Maven to be available at /home/hudsonagent/maven # - Default java to be Java 17 # - "mvn" to be on the path RUN mkdir -p /home/hudsonagent && \ ln -fs $JAVA_HOME /home/hudsonagent/java11 && \ - ln -fs /usr/lib/jvm/zulu17 /home/hudsonagent/java17 && \ + ln -fs /usr/lib/jvm/jdk-17-oracle-x64 /home/hudsonagent/java17 && \ ln -fs /usr/lib/jvm/jdk8u312-b07 /home/hudsonagent/java8 && \ - ln -fs /usr/lib/jvm/zulu-7-amd64 /home/hudsonagent/java7 && \ ln -fs /home/hudsonagent/java17 /home/hudsonagent/java && \ ln -fs /home/hudsonagent/java/bin/java /usr/bin/java && \ ln -fs /root/apache-maven-$MAVEN_VERSION /home/hudsonagent/maven && \ diff --git a/build/README.md b/build/README.md index eb8b2dd..ab3f96a 100644 --- a/build/README.md +++ b/build/README.md @@ -6,7 +6,6 @@ This image adds the following XWiki-required build tools over the [`jenkins/ssh-slave`](https://hub.docker.com/r/jenkinsci/ssh-slave) base image provided by Jenkins: * VNC Server * Docker Client (to run our Docker-based tests) -* Java 7 (Should be removed once no build is using it anymore) * Java 8 (Should be removed once no build is using it anymore) * Java 11 is provided by the base image * Java 17 (the java version required to build XWiki master)