use of org.apache.maven.toolchain.ToolchainPrivate in project maven-plugins by apache.
the class ToolchainMojo method selectToolchain.
protected boolean selectToolchain(String type, Map<String, String> params) throws MojoExecutionException {
getLog().info("Required toolchain: " + getToolchainRequirementAsString(type, params));
int typeFound = 0;
try {
ToolchainPrivate[] tcs = getToolchains(type);
for (ToolchainPrivate tc : tcs) {
if (!type.equals(tc.getType())) {
// useful because of MNG-5716
continue;
}
typeFound++;
if (tc.matchesRequirements(params)) {
getLog().info("Found matching toolchain for type " + type + ": " + tc);
// store matching toolchain to build context
toolchainManagerPrivate.storeToolchainToBuildContext(tc, session);
return true;
}
}
} catch (MisconfiguredToolchainException ex) {
throw new MojoExecutionException("Misconfigured toolchains.", ex);
}
getLog().error("No toolchain " + ((typeFound == 0) ? "found" : ("matched from " + typeFound + " found")) + " for type " + type);
return false;
}
use of org.apache.maven.toolchain.ToolchainPrivate in project maven-plugins by apache.
the class ToolchainMojo method selectToolchain.
protected boolean selectToolchain(String type, Map<String, String> params) throws MojoExecutionException {
getLog().info("Required toolchain: " + getToolchainRequirementAsString(type, params));
int typeFound = 0;
try {
ToolchainPrivate[] tcs = getToolchains(type);
for (ToolchainPrivate tc : tcs) {
if (!type.equals(tc.getType())) {
// useful because of MNG-5716
continue;
}
typeFound++;
if (tc.matchesRequirements(params)) {
getLog().info("Found matching toolchain for type " + type + ": " + tc);
// store matching toolchain to build context
toolchainManagerPrivate.storeToolchainToBuildContext(tc, session);
return true;
}
}
} catch (MisconfiguredToolchainException ex) {
throw new MojoExecutionException("Misconfigured toolchains.", ex);
}
getLog().error("No toolchain " + ((typeFound == 0) ? "found" : ("matched from " + typeFound + " found")) + " for type " + type);
return false;
}
Aggregations