dist: trusty
language: java
sudo: false
install: true
addons:
  sonarcloud:
    organization: "oskari"
jdk:
  - oraclejdk8
  - openjdk8
  - oraclejdk11

addons:
  apt:
    packages:
      - oracle-java8-installer
      - openjdk-8-jdk

notifications:
  slack: oskari:N5vZf0lzsIGpQ8nAPRfHgQ91
  webhooks:
    urls:
      - secure: "VMrF0iHhaTi9pliXrBDjKVG8XzpKbrZeyIX1I38+zgWiH0LzoG7ciRVghiAF1grFK1/B8hhplr6vhMVPlxTsIYJQFLIsvbjjnYJmxEYuhODZZPn9trtaEjCwW0wbi0sdEry7bXi2bM2yUqA6Jl9lFeLA2TCudQ4ou5XjATtzMzo="


before_install: "echo \"MAVEN_OPTS='-Xms1g -Xmx2g'\" > ~/.mavenrc"

script:
  - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then mvn clean install; fi'
  - 'if [ "$TRAVIS_PULL_REQUEST"  = "false" ]; then mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar; fi'
cache:
  directories:
    - '$HOME/.m2/repository'
    - '$HOME/.sonar/cache'

dist: trusty
language: java
sudo: false
install: true
addons:
  sonarcloud:
    organization: "oskari"
jdk:
  - oraclejdk8
  - openjdk8
  - oraclejdk11

addons:
  apt:
    packages:
      - oracle-java8-installer
      - openjdk-8-jdk

notifications:
  slack: oskari:N5vZf0lzsIGpQ8nAPRfHgQ91
  webhooks:
    urls:
      - secure: "VMrF0iHhaTi9pliXrBDjKVG8XzpKbrZeyIX1I38+zgWiH0LzoG7ciRVghiAF1grFK1/B8hhplr6vhMVPlxTsIYJQFLIsvbjjnYJmxEYuhODZZPn9trtaEjCwW0wbi0sdEry7bXi2bM2yUqA6Jl9lFeLA2TCudQ4ou5XjATtzMzo="


before_install: "echo \"MAVEN_OPTS='-Xms1g -Xmx2g'\" > ~/.mavenrc"

script: mvn clean install
#  - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then mvn clean install; fi'
#  - 'if [ "$TRAVIS_PULL_REQUEST"  = "false" ]; then mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.host.url=https://sonarcloud.io; fi'
cache:
  directories:
    - '$HOME/.m2/repository'
    - '$HOME/.sonar/cache'

Remove Sonar for now as its causing problems
Remove Sonar for now as its causing problems