sourceDirectories = new String[]{sourceDirectory};
}
}
if (sourceDirectories != null) {
CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
compilerConfiguration.setOutputLocation(outputDirectory);
List classpathEntries = classpath(dependencies, extraClasspath, scope, resolver);
compilerConfiguration.setNoWarn(true);
compilerConfiguration.setClasspathEntries(classpathEntries);
compilerConfiguration.setSourceLocations(Arrays.asList(sourceDirectories));
Map<String,String> compilerOptions = new HashMap<String, String>();
compilerOptions.putAll(compilerConfiguration.getCompilerOptions());
String javaSpecificationVersionLevel = System.getProperty("java.specification.version.level");
System.out.println("Java Specification Version Level: " + javaSpecificationVersionLevel);
compilerOptions.put("-source", javaSpecificationVersionLevel);
compilerOptions.put("-target", javaSpecificationVersionLevel);
compilerConfiguration.setCompilerOptions(compilerOptions);
/* Compile with debugging info */
String debugAsString = System.getProperty("maven.compiler.debug", "true");
if (!Boolean.valueOf(debugAsString)) {
compilerConfiguration.setDebug(false);
}
else {
compilerConfiguration.setDebug(true);
}
List messages = compiler.compile(compilerConfiguration);
for (Object message : messages) {