efegokdemir opened a new pull request, #1159:
URL: https://github.com/apache/maven-compiler-plugin/pull/1159

   ## What
   
   Only record compiler outputs for incremental builds after the compiler 
reports success.
   
   ## Why
   
   When compilation fails after writing partial class files, 
`afterRebuildExecution` can save those files to `createdFiles.lst`. A later 
Maven invocation then treats the incomplete output as up to date and skips 
compilation, which can lead to errors such as `NoClassDefFoundError`.
   
   ## How
   
   Gate both incremental status persistence and compiled-output recording on 
`compilerResult.isSuccess()`. Failed compilations retain their existing error 
behavior, while successful retries update the incremental status normally. No 
public API or configuration changes are introduced.
   
   ## Testing
   
   - Confirmed the regression test failed before the change: failed compilation 
incorrectly created `createdFiles.lst`.
   - `mvn -Dtest=CompilerMojoTest test` — 17 tests passed.
   - `mvn -Prun-its verify` — 49 unit tests and 79 integration tests passed; 6 
integration tests were skipped for OS, JRE, or toolchain requirements.
   
   ## Checklist
   
   - [x] Addresses the existing GitHub issue #1140 (the Maven Compiler Plugin 
has moved from JIRA to GitHub Issues).
   - [x] Includes a regression test and a meaningful commit message.
   - [x] Ran the unit and integration test commands listed above.
   - [x] Contribution is licensed under the Apache License, Version 2.0.
   


-- 
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]

Reply via email to