mensinda commented on code in PR #312:
URL:
https://github.com/apache/maven-compiler-plugin/pull/312#discussion_r1993141044
##########
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:
Yes and no: I agree that the `try / finally` is not required for most
circumstances (regular `mvn clean compile`, etc.). However, maven also has the
`--fail-at-end` and `--fail-never` flags. In this case, the try finally could
make sense.
So, just to be on the safe side to not change the original behavior, I would
keep the `try / finally`. However, I am also open to removing it, if you would
prefer it that way.
--
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]