language: java

sudo: false
cache:
  directories:
      - $HOME/.m2

dist: trusty

before_install:
  - grep -q -z '<artifactId>killbill-oss-parent</artifactId>[[:space:]]\+<groupId>org.kill-bill.billing</groupId>[[:space:]]\+<version>[0-9\.]*-SNAPSHOT</version>' pom.xml && echo "killbill-oss-parent SNAPSHOT has been found, exiting." && exit 0 || true
  - echo "<settings><profiles><profile><repositories><repository><id>central</id><name>bintray</name><url>http://jcenter.bintray.com</url></repository></repositories><id>bintray</id></profile></profiles><activeProfiles><activeProfile>bintray</activeProfile></activeProfiles></settings>" > /var/tmp/settings.xml
  - |
    function keep_alive() {
      while true; do
        echo -en "\a"
        sleep 5
      done
    }
    keep_alive &

before_script:
  - jdk_switcher use $JDK

script: mvn -q -Djava.security.egd=file:/dev/./urandom -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN -Dorg.slf4j.simpleLogger.log.org.killbill.billing.util.cache=ERROR -Dorg.slf4j.simpleLogger.log.org.killbill.billing.lifecycle=ERROR -Dlogback.configurationFile=$PWD/profiles/killbill/src/test/resources/logback.travis.xml clean install $PHASE -pl '!beatrix,!profiles,!profiles/killbill,!profiles/killpay'
install: mvn -q -U install -DskipTests=true --settings /var/tmp/settings.xml

notifications:
  email:
    - kill-bill-commits@googlegroups.com

matrix:
  include:
    - env: PHASE="-Ptravis,jdk18" JDK=openjdk8
    - env: PHASE="-Pmysql,jdk18" JDK=openjdk8
    - env: PHASE="-Ppostgresql,jdk18" JDK=openjdk8
  fast_finish: true
