desruisseaux commented on code in PR #1162:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1162#discussion_r4731171648
##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -682,6 +682,34 @@ final Charset charset() {
@Parameter(property = "maven.compiler.useIncrementalCompilation")
protected Boolean useIncrementalCompilation;
+ /**
+ * The strategy to use for incremental compilation.
+ * <ul>
+ * <li>{@code timestamp} (default) — the existing timestamp-based
strategy from
+ * {@link IncrementalBuild}. Detects changes by comparing source
file modification
+ * times and triggers full rebuilds when files are added/removed or
dependencies change.
+ * Respects {@link #incrementalCompilation} aspects, {@code
staleMillis}, and
+ * {@code incrementalExcludes}.</li>
+ * <li>{@code graph} — dependency-graph-based strategy. Tracks
class-level dependencies
+ * by analysing bytecode after each compilation pass. When a source
file changes, only
+ * the source files that transitively depend on any of its classes
are recompiled. Any
+ * change to a class (API or implementation) cascades to all its
consumers.
+ * Full JPMS support including {@code module-info.java} and
+ * {@code module-info-patch.maven} tracking.
+ * <p>Requires JDK 24+ at runtime for bytecode analysis via {@code
java.lang.classfile}.
+ * On older JDKs, a warning is logged and the {@code timestamp}
strategy is used
+ * as a fallback.</p>
+ * <p>Note: the graph strategy has its own change detection (content
hashing) and does
+ * not use {@code staleMillis}, {@code incrementalExcludes}, or the
+ * {@link #incrementalCompilation} aspects. Setting {@link
#useIncrementalCompilation}
+ * to {@code false} disables this strategy and forces a full
rebuild.</p></li>
+ * </ul>
+ *
+ * @since 4.0.0-beta-7
+ */
+ @Parameter(property = "maven.compiler.incrementalStrategy", defaultValue =
"timestamp")
+ protected String incrementalStrategy;
Review Comment:
This option should be merged with `buildStrategy`. For example, it could be
a new strategy called `sources-transitive` or `sources-cascade`. It would be
the same as `sources` except that a change in a source file cascades to all
other sources files using it.
Don't modify this pull request, I will create a new one. This integration
work may be quite significant and take some time.
--
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]