use of org.apache.maven.toolchain.java.DefaultJavaToolChain in project tycho by eclipse.
the class AbstractOsgiCompilerMojo method configureJavaHome.
private void configureJavaHome(CompilerConfiguration compilerConfiguration) throws MojoExecutionException {
if (useJDK != JDKUsage.BREE) {
return;
}
String toolchainId = getTargetExecutionEnvironment().getProfileName();
DefaultJavaToolChain toolChain = toolchainProvider.findMatchingJavaToolChain(session, toolchainId);
if (toolChain == null) {
throw new MojoExecutionException("useJDK = BREE configured, but no toolchain of type 'jdk' with id '" + toolchainId + "' found. See http://maven.apache.org/guides/mini/guide-using-toolchains.html");
}
compilerConfiguration.addCompilerCustomArgument("use.java.home", toolChain.getJavaHome());
configureBootClassPath(compilerConfiguration, toolChain);
}
Aggregations