in src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java [1088:1119]
public void execute() throws MojoException {
JavaCompiler compiler = compiler();
Options configuration = parseParameters(compiler);
try {
compile(compiler, configuration);
} catch (RuntimeException e) {
String message = e.getLocalizedMessage();
if (message == null) {
message = e.getClass().getSimpleName();
} else if (e instanceof MojoException) {
int s = message.indexOf(System.lineSeparator());
if (s >= 0) {
message = message.substring(0, s); // Log only the first line.
}
}
MessageBuilder mb = messageBuilderFactory
.builder()
.strong("COMPILATION ERROR: ")
.a(message);
logger.error(mb.toString(), verbose ? e : null);
if (tipForCommandLineCompilation != null) {
logger.info(tipForCommandLineCompilation);
tipForCommandLineCompilation = null;
}
if (failOnError) {
throw e;
}
} catch (IOException e) {
logger.error("I/O error while compiling the project.", e);
throw new CompilationFailureException("I/O error while compiling the project.", e);
}
}