Skip to content

Commit 7b82b17

Browse files
Godinbenzonico
authored andcommitted
Do not use Chocolatey in Appveyor
Check of default Chocolatey feed fails from time to time. And this check was done for each build, even if Maven was already installed. Also by removing usage of Chocolatey we receive less files for cache, and can automatically select Apache mirror.
1 parent 87e0ff2 commit 7b82b17

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

appveyor.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ branches:
66

77
cache:
88
# Note that we don't use cache for local Maven repository - see https://github.com/SonarSource/sonar-java/pull/525
9-
- C:\ProgramData\chocolatey\bin -> appveyor.yml
10-
- C:\ProgramData\chocolatey\lib -> appveyor.yml
11-
- C:\bin\apache-maven-3.2.5 -> appveyor.yml
9+
- C:\Users\appveyor\maven -> appveyor.yml
1210

1311
install:
1412
- set MAVEN_VERSION=3.2.5
15-
- choco install maven -version %MAVEN_VERSION%
16-
- set PATH=%PATH%;C:\bin\apache-maven-%MAVEN_VERSION%\bin
13+
# Note that indentation is important here:
14+
- ps: |
15+
Add-Type -AssemblyName System.IO.Compression.FileSystem
16+
if (!(Test-Path -Path "C:\Users\appveyor\maven" )) {
17+
(new-object System.Net.WebClient).DownloadFile(
18+
"http://www.apache.org/dyn/closer.cgi?action=download&filename=maven/maven-3/$($env:MAVEN_VERSION)/binaries/apache-maven-$($env:MAVEN_VERSION)-bin.zip",
19+
"C:\Users\appveyor\maven.zip"
20+
)
21+
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\Users\appveyor\maven.zip", "C:\Users\appveyor\maven")
22+
}
23+
- set PATH=%PATH%;C:\Users\appveyor\maven\apache-maven-%MAVEN_VERSION%\bin
1724
- echo %JAVA_HOME%
1825
- if "%RUN%" == "ruling" (git submodule update --init --recursive)
1926

0 commit comments

Comments
 (0)