Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,17 @@ public void execute() throws MojoException {
supportedVersion = version;
}
}

Options configuration = parseParameters(compiler);
try {
// --- Fix for issue #1006: ensure <proc>only</proc> runs annotation processors
// ---
if ("only".equalsIgnoreCase(compilerConfiguration.getProc())) {
logger.info("Running annotation processors (proc: only)");
compile(compiler, configuration);
return;
}
// -------------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looking for the first time at this pull request seriously (my previous comment was only formatting). What is the purpose of this addition? It does exactly the same thing as before — just invoking compiler(compiler, configuration) — with only a log added.

compile(compiler, configuration);
} catch (RuntimeException e) {
String message = e.getLocalizedMessage();
Expand All @@ -1198,15 +1207,18 @@ public void execute() throws MojoException {
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;
}
Expand All @@ -1215,7 +1227,7 @@ public void execute() throws MojoException {
throw new CompilationFailureException("I/O error while compiling the project.", e);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep blank line between methods.

/**
* Creates a new task by taking a snapshot of the current configuration of this <abbr>MOJO</abbr>.
* This method creates the {@linkplain ToolExecutor#outputDirectory output directory} if it does not already exist.
Expand Down