HADOOP-14842. Hadoop 2.8.2 release build process get stuck due to java issue. Contributed by Junping Du.

This commit is contained in:
Junping Du 2017-09-08 13:07:52 -07:00
parent 2f439e5fa7
commit d0a0f24abc
2 changed files with 19 additions and 7 deletions

View File

@ -172,6 +172,15 @@ function domd5()
run "${MD5SUM}" "${1}" > "${1}.md5" run "${MD5SUM}" "${1}" > "${1}.md5"
} }
## @description set JAVA_HOME properly
## @audience public
## @stability unstable
function locate_jvm()
{
JAVA_HOME="$(ls -d /usr/lib/jvm/*${JVM_VERSION}* | grep "${JVM_HINT}" | head -1 )"
export JAVA_HOME
}
function header() function header()
{ {
echo echo
@ -185,6 +194,7 @@ function header()
echo "Version to create : ${HADOOP_VERSION}" echo "Version to create : ${HADOOP_VERSION}"
echo "Release Candidate Label: ${RC_LABEL##-}" echo "Release Candidate Label: ${RC_LABEL##-}"
echo "Source Version : ${DEFAULT_HADOOP_VERSION}" echo "Source Version : ${DEFAULT_HADOOP_VERSION}"
echo "Using JDK : ${JAVA_HOME}"
printf "\n\n" printf "\n\n"
} }
@ -283,6 +293,7 @@ function usage
echo "--asfrelease Make an ASF release" echo "--asfrelease Make an ASF release"
echo "--docker Use Hadoop's Dockerfile for guaranteed environment" echo "--docker Use Hadoop's Dockerfile for guaranteed environment"
echo "--dockercache Use a Docker-private maven cache" echo "--dockercache Use a Docker-private maven cache"
echo "--jvmhint=[filter] Simple filter to pick a JVM to use"
echo "--logdir=[path] Path to store logs" echo "--logdir=[path] Path to store logs"
echo "--mvncache=[path] Path to the maven cache to use" echo "--mvncache=[path] Path to the maven cache to use"
echo "--native Also build the native components" echo "--native Also build the native components"
@ -318,6 +329,9 @@ function option_parse
--indocker) --indocker)
INDOCKER=true INDOCKER=true
;; ;;
--jvmhint=*)
JVM_HINT=${i#*=}
;;
--logdir=*) --logdir=*)
LOGDIR=${i#*=} LOGDIR=${i#*=}
;; ;;
@ -475,9 +489,6 @@ function dockermode
echo "RUN mkdir -p /maven" echo "RUN mkdir -p /maven"
echo "RUN chown -R ${user_name} /maven" echo "RUN chown -R ${user_name} /maven"
# we always force build with the Oracle JDK
# but with the correct version
echo "ENV JAVA_HOME /usr/lib/jvm/java-${JVM_VERSION}-oracle"
echo "USER ${user_name}" echo "USER ${user_name}"
printf "\n\n" printf "\n\n"
) | docker build -t "${imgname}" - ) | docker build -t "${imgname}" -
@ -631,6 +642,8 @@ option_parse "${PARAMS[@]}"
dockermode dockermode
locate_jvm
header header
if [[ -n ${RC_LABEL} ]]; then if [[ -n ${RC_LABEL} ]]; then

View File

@ -70,7 +70,7 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
RUN cd /usr/share/maven/lib && ln -s ../../java/commons-lang.jar . RUN cd /usr/share/maven/lib && ln -s ../../java/commons-lang.jar .
####### #######
# Oracle Java # Java OpenJDK
####### #######
RUN echo "dot_style = mega" > "/root/.wgetrc" RUN echo "dot_style = mega" > "/root/.wgetrc"
@ -80,9 +80,8 @@ RUN apt-get -q install --no-install-recommends -y software-properties-common
RUN add-apt-repository -y ppa:webupd8team/java RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get -q update RUN apt-get -q update
# Auto-accept the Oracle JDK license # Install OpenJDK 7
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections RUN apt-get -q install --no-install-recommends -y openjdk-7-jdk
RUN apt-get -q install --no-install-recommends -y oracle-java8-installer
###### ######
# Install findbugs # Install findbugs