oehme commented on code in PR #312:
URL:
https://github.com/apache/maven-compiler-plugin/pull/312#discussion_r1993248776
##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -703,8 +703,39 @@ protected final Optional<Path> getModuleDeclaration(final
Set<File> sourceFiles)
private boolean targetOrReleaseSet;
@Override
- @SuppressWarnings("checkstyle:MethodLength")
public void execute() throws MojoExecutionException,
CompilationFailureException {
+ try {
+ executeReal();
+ } finally {
+ addGeneratedSourcesToProject();
+ }
Review Comment:
Try-finally is necessary, because there are several `return` points in the
method and doing a finally block is the easiest way to ensure this work gets
done, no matter how these `return`s are shuffled around in the future. It
actually has nothing to do with failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]