mirror of
https://github.com/stCarolas/setup-maven.git
synced 2024-11-23 03:16:08 +08:00
commit
021645c4b6
@ -51,7 +51,7 @@ exports.getMaven = getMaven;
|
|||||||
function downloadMaven(version) {
|
function downloadMaven(version) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const toolDirectoryName = `apache-maven-${version}`;
|
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}`);
|
console.log(`downloading ${downloadUrl}`);
|
||||||
try {
|
try {
|
||||||
const downloadPath = yield tc.downloadTool(downloadUrl);
|
const downloadPath = yield tc.downloadTool(downloadUrl);
|
||||||
|
@ -32,17 +32,16 @@ export async function getMaven(version: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function downloadMaven(version: string): Promise<string> {
|
async function downloadMaven(version: string): Promise<string> {
|
||||||
const toolDirectoryName = `apache-maven-${version}`
|
const toolDirectoryName = `apache-maven-${version}`;
|
||||||
const downloadUrl =
|
const downloadUrl = `https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${version}/apache-maven-${version}-bin.tar.gz`;
|
||||||
`https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${version}/apache-maven-${version}-bin.tar.gz`
|
console.log(`downloading ${downloadUrl}`);
|
||||||
console.log(`downloading ${downloadUrl}`)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloadPath = await tc.downloadTool(downloadUrl)
|
const downloadPath = await tc.downloadTool(downloadUrl);
|
||||||
const extractedPath = await tc.extractTar(downloadPath)
|
const extractedPath = await tc.extractTar(downloadPath);
|
||||||
let toolRoot = path.join(extractedPath, toolDirectoryName)
|
let toolRoot = path.join(extractedPath, toolDirectoryName);
|
||||||
return await tc.cacheDir(toolRoot, 'maven', version)
|
return await tc.cacheDir(toolRoot, 'maven', version);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw err
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user