sudo: required

services:
  - docker

language: java

jdk:
  - openjdk8
  - openjdk9
  - openjdk10
  - openjdk11

env:
  global:
    - SONATYPE_USERNAME=mattbrownspotify
    - secure: "WH+C0QLvcp/NFVRngliA0F/aj0caK7/hsc1mapdApM71+Sncem1BScMpkpc3PRql8CRDjI/dDPNnqitcd89P1ros3jpAS9+qnMlzzNebWZ2oUaxIQe8iK89825sBJZhWMtOvl9LXlL6azacZuYOfNpbfCBb3t4Zi09Hi9QMlTKQ="

branches:
  only:
    - master

before_install:
  # troubleshooting info in case of problems
  - docker version
  - docker info

script: mvn clean verify -B

after_success:
  # test coverage reporting
  - bash <(curl -s https://codecov.io/bash)
  # deploy snapshots to Maven central, but only from master branch
  - "[[ $TRAVIS_BRANCH == \"master\" ]] && mvn --settings sonatype-settings.xml -DskipTests -B deploy"

sudo: required

services:
  - docker

language: java

matrix:
  include:
    - jdk: openjdk8
    - jdk: openjdk9
      before_install:
        - rm "${JAVA_HOME}/lib/security/cacerts"
        - ln -s /etc/ssl/certs/java/cacerts "${JAVA_HOME}/lib/security/cacerts"
    - jdk: openjdk10
      before_install:
        - rm "${JAVA_HOME}/lib/security/cacerts"
        - ln -s /etc/ssl/certs/java/cacerts "${JAVA_HOME}/lib/security/cacerts"
    - jdk: openjdk11

env:
  global:
    - SONATYPE_USERNAME=mattbrownspotify
    - secure: "WH+C0QLvcp/NFVRngliA0F/aj0caK7/hsc1mapdApM71+Sncem1BScMpkpc3PRql8CRDjI/dDPNnqitcd89P1ros3jpAS9+qnMlzzNebWZ2oUaxIQe8iK89825sBJZhWMtOvl9LXlL6azacZuYOfNpbfCBb3t4Zi09Hi9QMlTKQ="

branches:
  only:
    - master

before_install:
  # troubleshooting info in case of problems
  - docker version
  - docker info

script: mvn clean verify -B

after_success:
  # test coverage reporting
  - bash <(curl -s https://codecov.io/bash)
  # deploy snapshots to Maven central, but only from master branch
  - "[[ $TRAVIS_BRANCH == \"master\" ]] && mvn --settings sonatype-settings.xml -DskipTests -B deploy"

Fix Travis CI builds for openjdk[9|10]
Fix Travis CI builds for openjdk[9|10]

Travis CI builds for openjdk[9|10] currently fail with

```
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
```

when trying to pull dependencies from Sonatype.

Fix by manually symlinking the system CA certs in the before_install stage.

See https://github.com/travis-ci/travis-ci/issues/9368#issuecomment-395470644.
