# use java support.
language: java

# run in container.
sudo: false

# use linux as operating system.
os: linux

matrix:
  fast_finish: true
  include:
    - jdk: openjdk8
      if: branch = master OR tag =~ ^v1\.[0-9]+\.[0-9]+ # match v1.x.x
    - jdk: openjdk11
      if: branch = jdk10 OR tag =~ ^v2\.[0-9]+\.[0-9]+ # match v2.x.x

# configure xvfb screen.
before_install:
  - sudo apt-get install -y openjfx
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

# skip install stage.
install: true

# run maven build.
script:
  - mvn test

cache:
  directories:
  - $HOME/.m2

deploy:
  # Deploy snapshots & releases on every commit made to master
  - provider: script
    script: "cp .travis.settings.xml $HOME/.m2/settings.xml && mvn deploy"
    skip_cleanup: true
    on:
      all_branches: true
# use java support.
language: java

# run in container.
sudo: false

# use linux as operating system.
os: linux

matrix:
  fast_finish: true
  include:
    - jdk: openjdk8
      if: branch = master OR tag =~ ^v1\.[0-9]+\.[0-9]+ # match v1.x.x
    - jdk: openjdk11
      if: branch = jdk10 OR tag =~ ^v2\.[0-9]+\.[0-9]+ # match v2.x.x

# configure xvfb screen.
services:
  - xvfb

before_install:
  - sudo apt-get install -y openjfx

# skip install stage.
install: true

# run maven build.
script:
  - mvn test

cache:
  directories:
  - $HOME/.m2

deploy:
  # Deploy snapshots & releases on every commit made to master
  - provider: script
    script: "cp .travis.settings.xml $HOME/.m2/settings.xml && mvn deploy"
    skip_cleanup: true
    on:
      all_branches: true
Switch to xvfb service declaration
Switch to xvfb service declaration

Travis CI released a breaking change affecting how to start xvfb
https://changelog.travis-ci.com/ubuntu-xenial-16-04-build-environment-update-86123
