From 7635506a322a041b301994a2c31b6365b8c534f1 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Mon, 27 Jun 2022 11:58:12 +0200 Subject: [PATCH] Apply recent changes This is the result of "npm run build && npm run format", see: https://github.com/stCarolas/setup-maven/blob/417e1a9899611c0350621d1fb0c2770f35105c69/package.json#L37 Fixes #18 Signed-off-by: Wouter Born --- lib/installer.js | 2 +- src/installer.ts | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/installer.js b/lib/installer.js index d8688ad..867191f 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -51,7 +51,7 @@ exports.getMaven = getMaven; function downloadMaven(version) { return __awaiter(this, void 0, void 0, function* () { const toolDirectoryName = `apache-maven-${version}`; - const downloadUrl = `https://archive.apache.org/dist/maven/maven-3/${version}/binaries/${toolDirectoryName}-bin.tar.gz`; + const downloadUrl = `https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${version}/apache-maven-${version}-bin.tar.gz`; console.log(`downloading ${downloadUrl}`); try { const downloadPath = yield tc.downloadTool(downloadUrl); diff --git a/src/installer.ts b/src/installer.ts index bbf2109..5eabd27 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -32,17 +32,16 @@ export async function getMaven(version: string) { } async function downloadMaven(version: string): Promise { - const toolDirectoryName = `apache-maven-${version}` - const downloadUrl = - `https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${version}/apache-maven-${version}-bin.tar.gz` - console.log(`downloading ${downloadUrl}`) + const toolDirectoryName = `apache-maven-${version}`; + const downloadUrl = `https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${version}/apache-maven-${version}-bin.tar.gz`; + console.log(`downloading ${downloadUrl}`); try { - const downloadPath = await tc.downloadTool(downloadUrl) - const extractedPath = await tc.extractTar(downloadPath) - let toolRoot = path.join(extractedPath, toolDirectoryName) - return await tc.cacheDir(toolRoot, 'maven', version) + const downloadPath = await tc.downloadTool(downloadUrl); + const extractedPath = await tc.extractTar(downloadPath); + let toolRoot = path.join(extractedPath, toolDirectoryName); + return await tc.cacheDir(toolRoot, 'maven', version); } catch (err) { - throw err + throw err; } }