gnodet commented on PR #1123: URL: https://github.com/apache/maven-compiler-plugin/pull/1123#issuecomment-5877242812
While working on this PR, we did a deeper analysis of what `incrementalCompilation` actually does — and the name itself may be misleading. In Maven, compilation is bounded by the jar bridge: each module compiles against its dependencies' JARs, not their sources. This means true incremental compilation (recompile only the changed class and its transitive dependents) is only theoretically possible *within* a single module, and even then requires significant infrastructure — dependency graph, structural change detection, multi-pass bytecode analysis. No mode in 3.x or 4.x does this, and the Javadoc added by this PR documents this explicitly. What `incrementalCompilation` actually does is *change detection at the module level*: decide whether the module needs recompilation at all, and if so, whether to pass all sources or only the modified ones to javac. It never recompiles a changed class together with its dependents. Since this parameter was introduced in 4.x (still in beta), and compatibility was already broken when going from the 3.x boolean `useIncrementalCompilation` to the current string enum, renaming it now has zero additional migration cost. A few candidates: - `rebuildStrategy` — precise: describes the decision of *when* and *how much* to rebuild - `changeDetectionStrategy` — accurate: names what the aspects actually do (detect options/dependency/source changes) - `incrementalStrategy` — keeps the connection to Maven's broader incremental build concept (skipping unchanged modules) without implying compiler-level dependency tracking - `compilationStrategy` — broadest, covers both change detection and rebuild scope We would be happy to expand the scope of this PR to include the rename if there is consensus on a name. Thoughts? @desruisseaux -- 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]
