Skip to content

Commit 9821b94

Browse files
authored
HADOOP-16888. [JDK11] Support JDK11 in the precommit job (#2012)
* Install JDK 11 in the docker image * Refactor Dockerfile * Add compile test with JDK11 via Yetus multijdk feature
1 parent d50e93c commit 9821b94

File tree

2 files changed

+18
-40
lines changed

2 files changed

+18
-40
lines changed

Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ pipeline {
154154
# use emoji vote so it is easier to find the broken line
155155
YETUS_ARGS+=("--github-use-emoji-vote")
156156
157+
# test with Java 8 and 11
158+
YETUS_ARGS+=("--java-home=/usr/lib/jvm/java-8-openjdk-amd64")
159+
YETUS_ARGS+=("--multijdkdirs=/usr/lib/jvm/java-11-openjdk-amd64")
160+
YETUS_ARGS+=("--multijdktests=compile")
161+
157162
"${TESTPATCHBIN}" "${YETUS_ARGS[@]}"
158163
'''
159164
}

dev-support/docker/Dockerfile

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@ RUN echo APT::Install-Suggests "0"\; >> /etc/apt/apt.conf.d/10disableextras
3333
ENV DEBIAN_FRONTEND noninteractive
3434
ENV DEBCONF_TERSE true
3535

36-
######
37-
# Install common dependencies from packages. Versions here are either
38-
# sufficient or irrelevant.
39-
#
40-
# WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
41-
# Ubuntu Java. See Java section below!
42-
######
4336
# hadolint ignore=DL3008
4437
RUN apt-get -q update \
4538
&& apt-get -q install -y --no-install-recommends \
39+
ant \
4640
apt-utils \
4741
bats \
4842
build-essential \
@@ -51,11 +45,13 @@ RUN apt-get -q update \
5145
cmake \
5246
curl \
5347
doxygen \
48+
findbugs \
5449
fuse \
5550
g++ \
5651
gcc \
5752
git \
5853
gnupg-agent \
54+
libbcprov-java \
5955
libbz2-dev \
6056
libcurl4-openssl-dev \
6157
libfuse-dev \
@@ -64,11 +60,13 @@ RUN apt-get -q update \
6460
libsasl2-dev \
6561
libsnappy-dev \
6662
libssl-dev \
67-
libsnappy-dev \
6863
libtool \
6964
libzstd1-dev \
7065
locales \
7166
make \
67+
maven \
68+
openjdk-11-jdk \
69+
openjdk-8-jdk \
7270
pinentry-curses \
7371
pkg-config \
7472
python \
@@ -86,15 +84,13 @@ RUN apt-get -q update \
8684
&& apt-get clean \
8785
&& rm -rf /var/lib/apt/lists/*
8886

89-
90-
#######
91-
# OpenJDK 8
92-
#######
93-
# hadolint ignore=DL3008
94-
RUN apt-get -q update \
95-
&& apt-get -q install -y --no-install-recommends openjdk-8-jdk libbcprov-java \
96-
&& apt-get clean \
97-
&& rm -rf /var/lib/apt/lists/*
87+
######
88+
# Set env vars required to build Hadoop
89+
######
90+
ENV MAVEN_HOME /usr
91+
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
92+
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
93+
ENV FINDBUGS_HOME /usr
9894

9995
######
10096
# Install Google Protobuf 3.7.1 (3.0.0 ships with Bionic)
@@ -113,29 +109,6 @@ RUN mkdir -p /opt/protobuf-src \
113109
ENV PROTOBUF_HOME /opt/protobuf
114110
ENV PATH "${PATH}:/opt/protobuf/bin"
115111

116-
######
117-
# Install Apache Maven 3.6.0 (3.6.0 ships with Bionic)
118-
######
119-
# hadolint ignore=DL3008
120-
RUN apt-get -q update \
121-
&& apt-get -q install -y --no-install-recommends maven \
122-
&& apt-get clean \
123-
&& rm -rf /var/lib/apt/lists/*
124-
ENV MAVEN_HOME /usr
125-
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
126-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
127-
128-
######
129-
# Install findbugs 3.1.0 (3.1.0 ships with Bionic)
130-
# Ant is needed for findbugs
131-
######
132-
# hadolint ignore=DL3008
133-
RUN apt-get -q update \
134-
&& apt-get -q install -y --no-install-recommends findbugs ant \
135-
&& apt-get clean \
136-
&& rm -rf /var/lib/apt/lists/*
137-
ENV FINDBUGS_HOME /usr
138-
139112
####
140113
# Install pylint at fixed version (2.0.0 removed python2 support)
141114
# https://github.com/PyCQA/pylint/issues/2294

0 commit comments

Comments
 (0)