Skip to content

Commit

Permalink
Upgrade JDK and Maven on Travis
Browse files Browse the repository at this point in the history
 * JDK 1.8.0_121
 * Maven 3.3.9
  • Loading branch information
Simon Brandhof committed Feb 21, 2017
1 parent 3716bfe commit 474ace2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cache:
- server/sonar-web/node
- server/sonar-web/node_modules
- $HOME/jvm
- $HOME/maven
- $HOME/phantomjs

before_cache:
Expand Down
35 changes: 28 additions & 7 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,43 @@ function installPhantomJs {
}

#
# A (too) old version of JDK8 is installed by default on Travis
# A (too) old version of JDK8 is installed by default on Travis.
# This method is preferred over Travis apt oracle-java8-installer because
# JDK is kept in cache. It does not need to be downloaded from Oracle
# at each build.
#
function installJdk8 {
echo "Setup JDK 1.8u92"
echo "Setup JDK 1.8u121"
mkdir -p ~/jvm
pushd ~/jvm > /dev/null
if [ ! -d "jdk1.8.0_92" ]; then
if [ ! -d "jdk1.8.0_121" ]; then
echo "Download JDK8"
wget -c --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz
tar xzf jdk-8u92-linux-x64.tar.gz
rm jdk-8u92-linux-x64.tar.gz
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
tar xzf jdk-8u121-linux-x64.tar.gz
rm jdk-8u121-linux-x64.tar.gz
fi
popd > /dev/null
export JAVA_HOME=~/jvm/jdk1.8.0_92
export JAVA_HOME=~/jvm/jdk1.8.0_121
export PATH=$JAVA_HOME/bin:$PATH
}

#
# Maven 3.2.5 is installed by default on Travis. Maven 3.3.9 is preferred.
#
function installMaven {
echo "Setup Maven"
mkdir -p ~/maven
pushd ~/maven > /dev/null
if [ ! -d "apache-maven-3.3.9" ]; then
echo "Download Maven 3.3.9"
curl -sSL http://apache.mirrors.ovh.net/ftp.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz | tar zx -C ~/maven
tar xzf apache-maven-3.3.9-bin.tar.gz
rm apache-maven-3.3.9-bin.tar.gz
fi
popd > /dev/null
export M2_HOME=~/maven/apache-maven-3.3.9
export PATH=$M2_HOME/bin:$PATH
}
#
# Replaces the SNAPSHOT version by a version identifying the build.
#
Expand Down Expand Up @@ -95,6 +115,7 @@ BUILD)
./clock.sh &

installJdk8
installMaven
fixBuildVersion

# Minimal Maven settings
Expand Down

0 comments on commit 474ace2

Please sign in to comment.