in core-it-support/core-it-plugins/maven-it-plugin-toolchain/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java [81:124]
public void execute() throws MojoExecutionException {
ToolchainPrivate[] tcs = getToolchains();
getLog().info("[MAVEN-CORE-IT-LOG] Toolchains in plugin: " + Arrays.asList(tcs));
if (selected >= 0) {
if (selected < tcs.length) {
ToolchainPrivate toolchain = tcs[selected];
toolchainManager.storeToolchainToBuildContext(toolchain, session);
} else {
getLog().warn("[MAVEN-CORE-IT-LOG] Toolchain #" + selected + " can't be selected, found only "
+ tcs.length);
}
}
Properties properties = new Properties();
int count = 1;
for (Iterator<ToolchainPrivate> i = Arrays.<ToolchainPrivate>asList(tcs).iterator(); i.hasNext(); count++) {
ToolchainPrivate toolchain = i.next();
String foundTool = toolchain.findTool(tool);
if (foundTool != null) {
properties.setProperty("tool." + count, foundTool);
}
}
OutputStream out = null;
try {
outputFile.getParentFile().mkdirs();
out = new FileOutputStream(outputFile);
properties.store(out, "MAVEN-CORE-IT-LOG");
} catch (IOException e) {
throw new MojoExecutionException(e.getMessage(), e);
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
// ignore
}
}
}
}