From 727077e0ff0bd677ec6dc11fd8d91185fa3accf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Caba=20=C5=A0agi?= <75226367+csaba-sagi-sonarsource@users.noreply.github.com> Date: Wed, 27 Oct 2021 09:42:35 +0200 Subject: [PATCH] Fix scannerCli download (#1091) --- scripts/package-artifacts.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/package-artifacts.ps1 b/scripts/package-artifacts.ps1 index 7ba8cae45..99f7e951e 100644 --- a/scripts/package-artifacts.ps1 +++ b/scripts/package-artifacts.ps1 @@ -43,13 +43,11 @@ function Download-ScannerCli() { $artifactoryUrl = "https://repox.jfrog.io/repox"; } - $scannerCliUrl = $artifactoryUrl + "/sonarsource-public-releases/org/sonarsource/scanner/cli/sonar-scanner-cli/$scannerCliVersion/$scannerCliArtifact"; - if (!(Test-Path -LiteralPath $scannerCliDownloadDir)) { New-Item -Path $scannerCliDownloadDir -ItemType Directory -ErrorAction Stop -Force } - if (!(Test-Path -LiteralPath $scannerCliDownloadDir\$scannerCliArtifact)) { - Invoke-WebRequest -Uri $scannerCliUrl -OutFile $scannerCliDownloadDir\$scannerCliArtifact - } + mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get -DremoteRepositories=$artifactoryUrl -Dartifact="org.sonarsource.scanner.cli:sonar-scanner-cli:${scannerCliVersion}:zip" -Dtransitive=false + + mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy -Dartifact="org.sonarsource.scanner.cli:sonar-scanner-cli:${scannerCliVersion}:zip" -DoutputDirectory="${scannerCliDownloadDir}" } \ No newline at end of file