From d2d013b78fc50596246707352659cae64a94bf85 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Fri, 8 May 2020 20:59:59 +0200 Subject: [PATCH] use Java >11.0.2 instead of Java 12 on Travis (FINERACT-937) by ditching Travis' own sad state of Java (cough) 'support' and just re-installing it ourselves instead --- .travis.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8823237f..f3da52d34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,14 +16,11 @@ # under the License. # -# https://issues.apache.org/jira/browse/FINERACT-763 +# https://docs.travis-ci.com/user/reference/linux/ +# Must use a fixed distribution (and remember to occassionally upgrade..) +# to avoid surprise changes such as https://issues.apache.org/jira/browse/FINERACT-763 dist: bionic -language: java - -jdk: - - openjdk12 - services: - mysql - docker @@ -34,7 +31,20 @@ addons: # https://httpie.org is used by the docker-compose test below - httpie +# See https://issues.apache.org/jira/browse/FINERACT-937 for background re. what below is all about.. +# We basically remove the outdated OpenJDK 11.0.2 which Travis image grabbed from java.net in +# https://github.com/travis-ci/travis-cookbooks/blob/master/cookbooks/travis_jdk/files/install-jdk.sh#L200 +# (which has 11.0.2 hard-coded!), and instead replace it with the latest openjdk-11-jdk-headless Ubuntu package. +# NB /usr/local/lib/jvm/openjdk11/bin is also on the PATH, but there's no need to change it (because we rm -rf anyway) before_install: + - echo $JAVA_HOME + - which java + - sudo rm -rf /usr/local/lib/jvm/ + - sudo apt-get install -y openjdk-11-jdk-headless + - export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ + - which java + - java -version + - $JAVA_HOME/bin/java -version - echo "USE mysql;\nALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql';\n" | mysql -u root - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_tenants`;' - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_default`;'