environment:
  MVN_VERSION: 3.3.9

install:
  - ps: |
      Add-Type -AssemblyName System.IO.Compression.FileSystem
      if (!(Test-Path -Path "C:\maven" )) {
        (New-Object 'System.Net.WebClient').DownloadFile("http://www.us.apache.org/dist/maven/maven-3/$($env:MVN_VERSION)/binaries/apache-maven-$($env:MVN_VERSION)-bin.zip", "C:\maven-bin.zip")
        [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
      }
  - set PATH=C:\maven\apache-maven-%MVN_VERSION%\bin;%PATH%
  - cmd: mvn --version
  - cmd: java -version

cache:
  - C:\maven\
  - C:\Users\appveyor\.m2\repository -> pom.xml

build_script:
  - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V  # This is what Travis CI does by default.

test_script:
  - mvn test -B  # This is what Travis CI does by default.

after_test:
  - ps: |
      $url = "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)"
      $files = Get-ChildItem '.\target\surefire-reports\junitreports\TEST-*.xml'
      ForEach ($file in $files) {
          (New-Object 'System.Net.WebClient').UploadFile($url, (Resolve-Path $file))
      }

artifacts:
  - path: target\*.jar
    name: Java archive

environment:
  MVN_VERSION: 3.3.9.1

install:
  - cinst maven --version=%MVN_VERSION% -y
  - set PATH=C:\tools\apache-maven-%MVN_VERSION%\bin;%PATH%

cache:
  - C:\Users\appveyor\.m2\repository -> pom.xml

build_script:
  - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V  # This is what Travis CI does by default.

test_script:
  - mvn test -B  # This is what Travis CI does by default.

after_test:
  - ps: |
      $url = "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)"
      $files = Get-ChildItem '.\target\surefire-reports\junitreports\TEST-*.xml'
      ForEach ($file in $files) {
          (New-Object 'System.Net.WebClient').UploadFile($url, (Resolve-Path $file))
      }

artifacts:
  - path: target\*.jar
    name: Java archive

Revert to using Chocolatey to install Maven
Revert to using Chocolatey to install Maven

This party reverts commit a25f9b0 and bumps the Maven version to 3.3.9.1
as 3.3.9 indeed is not available on Chocolatey.
