mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 09:26:46 +00:00
Add Maven Toolchains Declaration (#276)
* Add (optional) Maven Toolchains Declaration after JDK is installed * Extract common/shared Maven constants Resolves #276
This commit is contained in:
parent
499ae9c28b
commit
eb1418aa81
11 changed files with 774 additions and 20 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as auth from './auth';
|
||||
import { getBooleanInput, isCacheFeatureAvailable } from './util';
|
||||
import * as toolchains from './toolchains';
|
||||
import * as constants from './constants';
|
||||
import { restore } from './cache';
|
||||
import * as path from 'path';
|
||||
|
@ -16,9 +17,14 @@ async function run() {
|
|||
const jdkFile = core.getInput(constants.INPUT_JDK_FILE);
|
||||
const cache = core.getInput(constants.INPUT_CACHE);
|
||||
const checkLatest = getBooleanInput(constants.INPUT_CHECK_LATEST, false);
|
||||
let toolchainIds = core.getMultilineInput(constants.INPUT_MVN_TOOLCHAIN_ID);
|
||||
|
||||
if (versions.length !== toolchainIds.length) {
|
||||
toolchainIds = [];
|
||||
}
|
||||
|
||||
core.startGroup('Installed distributions');
|
||||
for (const version of versions) {
|
||||
for (const [index, version] of versions.entries()) {
|
||||
const installerOptions: JavaInstallerOptions = {
|
||||
architecture,
|
||||
packageType,
|
||||
|
@ -32,6 +38,12 @@ async function run() {
|
|||
}
|
||||
|
||||
const result = await distribution.setupJava();
|
||||
await toolchains.configureToolchains(
|
||||
version,
|
||||
distributionName,
|
||||
result.path,
|
||||
toolchainIds[index]
|
||||
);
|
||||
|
||||
core.info('');
|
||||
core.info('Java configuration:');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue