language: java
branches:
  only:
  - master
  - /^\d+\.\d+$/
cache:
  directories:
    - $HOME/.m2
before_cache:
  - rm -rf $HOME/.m2/repository/io/vertx/
jobs:
  include:
    - stage: test
      name: "OpenJDK 8"
      jdk: openjdk8
      script: mvn -q clean verify -B
    - if: type != pull_request
      name: "OpenJDK 11"
      jdk: openjdk11
      script: mvn -q clean verify -B
    - if: type != pull_request
      name: "OpenJDK 8 / native transport"
      jdk: openjdk8
      # Workaround, only execute some tests as Netty epoll has slow shutdown (https://github.com/netty/netty/issues/9678)
      script: mvn -q clean verify -B -PtestNativeTransport -Dtest=NetTest,Http*Test,HostnameResolutionTest
    - if: type != pull_request
      name: "OpenJDK 8 / domain sockets"
      jdk: openjdk8
      # Workaround, only execute some tests as Netty epoll has slow shutdown (https://github.com/netty/netty/issues/9678)
      script: mvn -q clean verify -B -PtestDomainSockets -Dtest=NetTest,Http*Test,HostnameResolutionTest
    - stage: deploy
      name: "Deploy to Sonatype's snapshots repository"
      jdk: openjdk8
      if: type != pull_request AND env(SONATYPE_NEXUS_USERNAME) IS present
      script: bash .travis.deploy.artifacts.sh
notifications:
  email:
    recipients:
      - secure: "V3kSlUMaHLlFhnbGa567mdKv1/d4iPLHJEWi1llFDeLhu+pJsAGOZOFqr6bN9V0PJIdCGzr9/xqauA2kdunnqICM8iLga0/vvjZWB/G1SXrmPsL820szvU3Id/BLBJzbnZWPNbmMCSyFLgkUuAJ6QLMFGH56RqUst65Z2++VzHU="
    on_success: always
    on_failure: always
