language: java
dist: trusty
jdk:
  - oraclejdk11
node_js:
  - "node"
before_install:
  - nvm install 14.4.0
  - npm install -g hercule@5.0.0
script:
  - set -e
  - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V && mvn verify -B && mvn javadoc:aggregate && mvn checkstyle:check -P checkstyle
  - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then etc/prepareDocs.sh; fi
after_success:
  - set +e
  - if [ "$TRAVIS_BRANCH" = "master" ]; then mvn deploy -DskipTests=true --settings etc/snapshot-settings.xml; fi
deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GITHUB_TOKEN
  keep-history: true
  local-dir: docs
  on:
    branch: master
