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

notifications:
  slack: oskari:N5vZf0lzsIGpQ8nAPRfHgQ91

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

script:
  - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
cache:
  directories:
    - '$HOME/.m2/repository'
    - '$HOME/.sonar/cache'

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

notifications:
  slack: oskari:N5vZf0lzsIGpQ8nAPRfHgQ91

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'

Disable sonar for PRs as its not supported
Disable sonar for PRs as its not supported
