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

   Related to #1036.
   
   **Draft for design review. A known correctness regression blocks merging 
this change.**
   
   The current compiler plugin omits the output directory from the classpath 
during full compilation. This prevents Java sources from resolving classes 
written earlier by Kotlin, in both main and test compilation.
   
   This draft adds the output directory to the nonmodular classpath and covers 
main/test compilation with embedded and forked javac. The four native 
regressions fail on unchanged production code, and the reporter's mixed 
Kotlin/Java project passes with the initial implementation.
   
   Broader validation exposed stale Java bytecode reuse: after removing a 
source or a secondary class declaration, a full rebuild can incorrectly succeed 
by resolving the old class file from the output directory. The existing 
source-to-output cache cannot identify every javac-produced class. Reliable 
output ownership and cleanup are needed before enabling this behavior generally.
   
   The annotation-processor fixture also needed to disable processing while 
compiling its own provider, whose service descriptor is copied before its class 
exists. This is restricted to the provider module; the consuming module still 
exercises annotation processing. Compiler 3.15 reproduces the same provider 
self-discovery failure.
   
   Validation evidence:
   
   - Initial `clean verify` passed 20 tests on Java 17 and Java 21.
   - The reporter project passed normal and forked clean builds, with four 
tests each.
   - The initial full integration run reported 79 passed, two failed, and two 
skipped. The processor fixture was subsequently corrected, but the stale-class 
regression remains and no passing final full integration run is claimed.
   - A separate reproduction confirms incorrect success after removing a 
package-private class declaration from a source file that remains present.
   
   Proposed next step: agree on compiler-output ownership tracking, including 
partial/full builds, failed compilations, cache migration, multiple executions 
and multi-release outputs, while preserving classes generated by earlier 
compilers.
   
   - [x] The draft addresses one issue.
   - [x] The description and commit explain the change and its remaining 
blocker.
   - [x] Native regression tests fail without the runtime change.
   - [ ] Final `mvn verify` validation after resolving the blocker.
   - [ ] `mvn -Prun-its verify` passes.
   - [ ] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0).
   - [ ] File an [Apache Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf), as applicable.


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