HADOOP-14842. Hadoop 2.8.2 release build process get stuck due to java issue. Contributed by Junping Du.
(cherry picked from commit d0a0f24abc
)
This commit is contained in:
parent
2b09cec218
commit
eaf5c66f7e
|
@ -172,6 +172,15 @@ function domd5()
|
|||
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()
|
||||
{
|
||||
echo
|
||||
|
@ -185,6 +194,7 @@ function header()
|
|||
echo "Version to create : ${HADOOP_VERSION}"
|
||||
echo "Release Candidate Label: ${RC_LABEL##-}"
|
||||
echo "Source Version : ${DEFAULT_HADOOP_VERSION}"
|
||||
echo "Using JDK : ${JAVA_HOME}"
|
||||
printf "\n\n"
|
||||
}
|
||||
|
||||
|
@ -283,6 +293,7 @@ function usage
|
|||
echo "--asfrelease Make an ASF release"
|
||||
echo "--docker Use Hadoop's Dockerfile for guaranteed environment"
|
||||
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 "--mvncache=[path] Path to the maven cache to use"
|
||||
echo "--native Also build the native components"
|
||||
|
@ -318,6 +329,9 @@ function option_parse
|
|||
--indocker)
|
||||
INDOCKER=true
|
||||
;;
|
||||
--jvmhint=*)
|
||||
JVM_HINT=${i#*=}
|
||||
;;
|
||||
--logdir=*)
|
||||
LOGDIR=${i#*=}
|
||||
;;
|
||||
|
@ -475,9 +489,6 @@ function dockermode
|
|||
echo "RUN mkdir -p /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}"
|
||||
printf "\n\n"
|
||||
) | docker build -t "${imgname}" -
|
||||
|
@ -631,6 +642,8 @@ option_parse "${PARAMS[@]}"
|
|||
|
||||
dockermode
|
||||
|
||||
locate_jvm
|
||||
|
||||
header
|
||||
|
||||
if [[ -n ${RC_LABEL} ]]; then
|
||||
|
|
|
@ -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 .
|
||||
|
||||
#######
|
||||
# Oracle Java
|
||||
# Java OpenJDK
|
||||
#######
|
||||
|
||||
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 apt-get -q update
|
||||
|
||||
# Auto-accept the Oracle JDK license
|
||||
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 oracle-java8-installer
|
||||
# Install OpenJDK 7
|
||||
RUN apt-get -q install --no-install-recommends -y openjdk-7-jdk
|
||||
|
||||
######
|
||||
# Install findbugs
|
||||
|
|
Loading…
Reference in New Issue