aboutsummaryrefslogtreecommitdiffstats
path: root/travis.sh
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-21 10:17:15 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-21 11:45:50 +0100
commit474ace228f03d86a460b53d3bdb0e84d77359287 (patch)
treeaefe8c238afeb9d8b5d1a516d6a5dbeef49fdbb5 /travis.sh
parent3716bfea7ebed5a9f50e11157c2adfbfce40d6e5 (diff)
downloadsonarqube-474ace228f03d86a460b53d3bdb0e84d77359287.tar.gz
sonarqube-474ace228f03d86a460b53d3bdb0e84d77359287.zip
Upgrade JDK and Maven on Travis
* JDK 1.8.0_121 * Maven 3.3.9
Diffstat (limited to 'travis.sh')
-rwxr-xr-xtravis.sh35
1 files changed, 28 insertions, 7 deletions
diff --git a/travis.sh b/travis.sh
index 06cd9b812f5..bd859b3828c 100755
--- a/travis.sh
+++ b/travis.sh
@@ -17,24 +17,44 @@ 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.
#
# Exports the variables:
@@ -95,6 +115,7 @@ BUILD)
./clock.sh &
installJdk8
+ installMaven
fixBuildVersion
# Minimal Maven settings