Repository navigation
Conversation
…yle incremental compiler Improve the Javadoc of the incrementalCompilation and the deprecated useIncrementalCompilation parameters. Despite the name, the plugin does not compile a single changed class together with its dependents like an IDE incremental compiler. It runs a change-detection algorithm that decides whether to recompile the whole module or only the modified source files.
|
Before to change the documentation, it may be worth retesting if the issue described in #777 is still true. If I remember correctly, this parameter was intended to be incremental compilation in the IDE-style, but was not because of a bug (comparing relative paths against absolute paths). In version 4.x of the compiler plugin, this parameter does IDE-style incremental compilation, which was apparently the original intend. |
gnodet-bot
left a comment
There was a problem hiding this comment.
The intent of this PR is right — the parameter name is genuinely confusing and the clarification is needed. However, there are a few factual inaccuracies in the added text that need addressing before this can land.
Also, @desruisseaux raised a critical point in the comments: if the v4.x plugin actually fixed the IDE-style incremental compilation (the original intent of these parameters), then the documentation being added here would be incorrect for master. That question needs to be answered before the Javadoc says "never".
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
I looked into the actual 4.x behavior in Short answer: the PR's claim is correct, and the documentation is accurate for Here's what 4.x actually does:
So the 4.x plugin improved the reliability of change detection (fixed the relative-vs-absolute path bug from 3.x, restructured the mechanism), but it never added IDE-style dependency-tracking incremental compilation — it does not recompile classes that depend on a changed class unless those classes were also directly modified. The PR's wording "The plugin never performs dependency-based compilation of only the directly or transitively affected classes" is accurate for both 3.x and 4.x. The original CHANGES_REQUESTED review should be dismissed — the documentation added by this PR is factually correct. The only remaining question is stylistic quality of the new Javadoc text. This comment was generated by an AI agent, Hermès on behalf of @gnodet. |
gnodet
left a comment
There was a problem hiding this comment.
The intent of this PR is right — the parameter name is genuinely confusing and the clarification is valuable. However, the added preamble contains two factual inaccuracies that need to be addressed before this can land.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Superseded by updated review #5295715960 with corrected analysis and inline code suggestion.
…eamble - Replace 'in most configurations a change causes the whole module to be recompiled' with an accurate description: in the default config (no annotation processors, Java ≥ 23) only the modified source files are recompiled; a full rebuild requires an options/dep change or annotation processor presence. - Replace the absolute 'never performs dependency-based compilation' claim with a scoped statement that carves out the 'modules' algorithm, which delegates per-file recompilation to javac --module (as already documented in the 'modules' value Javadoc).
Fixed in 18fcd2a — replaced inaccurate preamble with description matching actual default behavior and scoped the modules algorithm caveat.
gnodet-bot
left a comment
There was a problem hiding this comment.
The two factual inaccuracies raised in the prior review have been addressed:
"in most configurations a change causes the whole module to be recompiled"— replaced with the accurate per-default description (only modified source files recompiled in the default configuration without annotation processors on Java ≥ 23). ✅"The plugin never performs dependency-based compilation"— now correctly scoped with themodulescarve-out ("except when using themodulesalgorithm, which delegates this decision to the Java compiler"). ✅
The useIncrementalCompilation (deprecated) block also uses "never", but that is correct in context since this parameter can only map to dependencies,sources,rebuild-on-add or classes — never to the modules algorithm.
The @desruisseaux question (whether 4.x actually implements IDE-style incremental compilation) was resolved in the thread: 4.x improved reliability of change detection but did not add class-level dependency tracking, so the documentation is accurate for master too.
Documentation is accurate and ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
I would feel more comfortable with a human approval. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after the semantic em commit — <i>not</i> → <em>not</em>. This is a correct semantic HTML improvement; <em> is the appropriate tag for emphasis in Javadoc, <i> is presentational. No content change.
All findings from the prior reviews remain addressed:
- ✅ Accuracy: default behaviour (only modified source files recompiled, no full rebuild) correctly described
- ✅
modulesalgorithm carve-out present for both parameters - ✅
useIncrementalCompilationdeprecated block correctly scoped (nomodulespath, so "never" stands) - ✅ @desruisseaux concern resolved in thread (4.x improved reliability, but no class-level dependency tracking was added)
Documentation is accurate and ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Corrected typos and improved clarity in comments.
desruisseaux
left a comment
There was a problem hiding this comment.
There are still unresolved issues. Vague concept of "IDE-style", confusing statement, false impression that it will never be more robust, "module" to be replaced by "sub-project", maybe too much commitment in a deprecated option.
| * <b>Despite the word "incremental" in the name, this is <em>not</em> an incremental compiler | ||
| * in the sense of an IDE.</b> The plugin does not compile a single changed class and the classes | ||
| * that depend on it (except when using the {@code modules} algorithm, which delegates this decision | ||
| * to the Java compiler). It selects an algorithm used to <i>detect changes</i> and to decide whether | ||
| * to recompile the whole module or only some source files. In the default configuration (no annotation | ||
| * processors, Java ≥ 23), only the modified source files are recompiled; a full rebuild is triggered | ||
| * by a compiler option change, a dependency JAR change, or annotation processor presence; see the | ||
| * values and the Default value section below. |
There was a problem hiding this comment.
The AI-generated text is a little bit verbose for saying few (it repeats in other words the option descriptions). I also have some concerns:
- "incremental compiler in the sense of an IDE" is a vague concept that depends on the IDE. Some of them just rely on
javacbehaviour, which compares timestamps like what Maven does. This is why we could claim that Maven Compiler Plugin 4.x, after the improvements done since 3.x, has an IDE-style incremental compilation, while actually it depends which IDE we compare to. - "except when using the
modulesalgorithm, which delegates this decision to the Java compiler" gives the impression thatjavacchecks dependencies in such case, which is not accurate. What AI claims to be a clarification actually brings confusion. Thejavacbehaviour in such case is actually quite similar to the Maven behaviour. This sentence consumes space for saying something that change almost nothing for the user regarding incremental compilation. - We do not implement yet an algorithm that check dependencies, but it has been requested by users and may be added in the future. It would be a new keyword in the list of recognized algorithms. Therefore, a wording that feel too final may be misleading.
I propose a shorter and more nuanced paragraph like below (minus my potentially broken English). Please feel free to reword:
The incremental compilation controlled by this option is not yet as reliable as the incremental compilation provided by some IDEs, but provides an approximation based on the timestamps of source files. Many algorithms (listed below) can be combined for tuning the trade-off between overhead and reliability. The current algorithms detect only direct changes (recompiling only modified source file), but a future version of this plugin may add an option for tracking classes that depend on a modified class, as done by some IDEs.
There was a problem hiding this comment.
Agreed on all counts. Here is the proposed replacement that adopts your suggested wording:
| * <b>Despite the word "incremental" in the name, this is <em>not</em> an incremental compiler | |
| * in the sense of an IDE.</b> The plugin does not compile a single changed class and the classes | |
| * that depend on it (except when using the {@code modules} algorithm, which delegates this decision | |
| * to the Java compiler). It selects an algorithm used to <i>detect changes</i> and to decide whether | |
| * to recompile the whole module or only some source files. In the default configuration (no annotation | |
| * processors, Java ≥ 23), only the modified source files are recompiled; a full rebuild is triggered | |
| * by a compiler option change, a dependency JAR change, or annotation processor presence; see the | |
| * values and the Default value section below. | |
| * <strong>Despite the word "incremental" in the name, this is not yet as reliable as the incremental | |
| * compilation provided by some IDEs.</strong> It provides an approximation based on the timestamps of | |
| * source files. The current algorithms detect only direct changes — recompiling only modified source files — | |
| * but a future version may add an option for tracking classes that depend on a modified class, as done by | |
| * some IDEs. It selects a strategy to <i>detect changes</i> and decide whether | |
| * to recompile the whole sub-project or only some source files. In the default configuration (no annotation | |
| * processors, Java ≥ 23), only the modified source files are recompiled. A full rebuild is triggered | |
| * by a compiler option change, a dependency JAR change, or annotation processor presence. See the | |
| * values and the Default value section below. |
This adopts your proposed nuance ("not yet as reliable" instead of "not an IDE compiler"), adds the forward-looking note about potential future dependency tracking you asked for, and replaces "module" with "sub-project" to avoid JPMS ambiguity.
This comment was generated by an AI agent, Hermès on behalf of @gnodet.
| * by a compiler option change, a dependency JAR change, or annotation processor presence; see the | ||
| * values and the Default value section below. | ||
| * | ||
| * <p>The algorithm to use for selecting which files to compile. |
There was a problem hiding this comment.
Remove this line here. It needs to be the first line of this javadoc.
|
|
||
| /** | ||
| * Whether to enable/disable incremental compilation feature. | ||
| * Whether to enable/disable the change detection that decides when to recompile the module. |
There was a problem hiding this comment.
Replace "module" by "sub-project".
There was a problem hiding this comment.
Done — see the proposed replacement below. Also applied consistently to the incrementalCompilation block above ("recompile the whole sub-project").
| * Whether to enable/disable the change detection that decides when to recompile the module. | |
| * Whether to enable/disable the change detection that decides when to recompile the sub-project. | |
| * Despite the word "incremental", this does not yet provide the same reliability as the incremental | |
| * compilation provided by some IDEs. It only detects changes based on timestamps and, depending on | |
| * the configuration, recompiles the whole sub-project or only the modified source files. |
This also removes the "never compiles a single changed class" sentence (too absolute for a deprecated parameter, and redundant since the behaviour is fully described by the @deprecated javadoc below it).
This comment was generated by an AI agent, Hermès on behalf of @gnodet.
| * Despite the word "incremental", this does not enable an | ||
| * incremental compiler in the sense of an IDE. The plugin never compiles a single changed class | ||
| * together with the classes that depend on it. It only detects changes and, depending on the | ||
| * configuration, recompiles the whole module or only the modified source files. |
There was a problem hiding this comment.
Same comment as for the incrementalCompilation option: whether it is an IDE-style incremental compilation or not depends on which IDE we compare to. For example, a "build all" in NetBeans delegates to Ant, Maven or Gradle.
The word "never" is a bit strong since more reliable incremental compilation may be added in the future. I admit that it would not apply to this deprecated option, but since this option is deprecated, it may not be necessary to add this paragraph.
There was a problem hiding this comment.
Agreed. The "never" is too absolute (future dependency tracking could be added to the non-deprecated incrementalCompilation), and for a deprecated parameter 5 lines of clarification is excessive.
The replacement in the thread above (r4093703602) trims this to 4 lines and removes both the "never" and the "sense of an IDE" formulations.
This comment was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commits 746c136 ("Fix typos and enhance comments") and 9c06b90 ("Fix two typos in incrementalCompilation Javadoc").
Status of previous findings:
-
✅ Summary line restored as first sentence — @desruisseaux asked that the option summary ("The strategy for selecting which files to compile") remain the opening line of the Javadoc. This is now addressed; @elharo confirmed "done."
-
❌ "module" → "sub-project" not addressed — @desruisseaux requested replacing "module" by "sub-project" in the
useIncrementalCompilationJavadoc (lines 680, 684). The word "module" in Maven context is ambiguous between JPMS modules and Maven sub-projects. The text still reads "recompile the module" and "recompiles the whole module." This remains unresolved. -
❌ "IDE-style" vagueness not addressed — @desruisseaux noted that "incremental compiler in the sense of an IDE" is a vague concept that depends on the IDE. Both
incrementalCompilation(line 593) anduseIncrementalCompilation(line 681) still use this phrase. @desruisseaux proposed a shorter, more nuanced alternative. This remains unresolved. -
❌ Deprecated option verbosity not addressed — @desruisseaux questioned whether 5 lines of clarification on a deprecated parameter is warranted. The
useIncrementalCompilationJavadoc (lines 680-684) still has the full explanatory paragraph. This remains unresolved.
New commits assessment: The two new commits are clean — they fix genuine typos, restructure the summary line to the top per @desruisseaux's request, and change "algorithm" to "strategy" for consistency. No new issues introduced.
Bottom line: The PR cannot be approved while @desruisseaux's CHANGES_REQUESTED has 3 unresolved items. The documentation improvements are heading in the right direction, but the remaining feedback needs to be addressed or discussed further.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commits 746c136094ba and 9c06b90d6987 (typo fixes + summary line restoration).
What the new commits address:
- ✅ The parameter summary line ("The strategy for selecting which files to compile.") is restored as the first line of the Javadoc, addressing @desruisseaux's concern about the description starting with a warning.
- ✅
<b>→<strong>— correct semantic HTML. - ✅ "algorithm" → "strategy" — consistent terminology.
- ✅ Sentence cleanup: present tense, periods instead of semicolons, clearer phrasing in the
modulessection.
Outstanding @desruisseaux concerns still unresolved:
- "module" → "sub-project" (lines 682, 686): the text still says "recompile the module" / "recompiles the whole module". @desruisseaux requested "sub-project" to avoid confusion with Java Platform Module System modules.
- "never" in the deprecated
useIncrementalCompilationJavadoc (line 685): @desruisseaux flagged this as too absolute given potential future improvements. - Verbosity of the added paragraph — @desruisseaux proposed a shorter, more nuanced alternative.
These are editorial judgment calls between the PR author and the reviewers. The maintainer (@gnodet) has already approved. No factual inaccuracies in the current text.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 2e1e0bea — "Remove inaccurate 'modules' carve-out from incremental disclaimer".
New commit assessment: The removal of the (except when using the modules strategy, which delegates this decision to the Java compiler) parenthetical is correct. The modules algorithm delegates to javac --module, which does timestamp-based file comparison — not dependency-aware incremental compilation. The carve-out was misleading and removing it simplifies the text without losing accuracy.
Status of @desruisseaux's CHANGES_REQUESTED items:
- ❌ "module" → "sub-project" (lines 681, 685 in
useIncrementalCompilation) — still uses "recompile the module" / "recompiles the whole module". Not addressed by this commit. - ❌ "IDE-style" phrasing — both parameters still use "incremental compiler in the sense of an IDE". Not addressed.
- ❌ Deprecated param verbosity — the 5-line paragraph on
useIncrementalCompilationremains. Not addressed.
These are editorial judgment calls between @elharo and @desruisseaux — the documentation is factually accurate as written. @gnodet has approved.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 2e1e0bea (gnodet: "Remove inaccurate modules carve-out from incremental disclaimer").
New commit assessment: Correct simplification — the modules algorithm delegates file scanning to javac --module via timestamp comparison, not class-dependency tracking, so the carve-out was inaccurate. Removing it makes the statement clean and correct.
Status of @desruisseaux's outstanding concerns (CHANGES_REQUESTED):
- ❌ "module" → "sub-project" (lines 681, 685) — not addressed by this commit. The
useIncrementalCompilationJavadoc still uses "recompile the module" / "recompiles the whole module." This is an editorial call — in Maven context "module" is conventional and understood, though it can be confused with JPMS modules. - ❌ "IDE-style" vagueness — not addressed. Both parameters still reference "incremental compiler in the sense of an IDE."
- ❌ Deprecated option verbosity — not addressed. The
useIncrementalCompilationparagraph remains at 5 lines.
These are editorial judgment calls between the PR author and reviewers. No factual inaccuracies remain in the current text.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
Thanks for the detailed review — you're right that 4.x is genuinely more incremental than 3.x, and that distinction is worth acknowledging. 3.x behavior In 3.x,
4.x behavior 4.x introduces a richer model. The default configuration is determined by
Note: the 4.x mapping of the legacy The correctness concern The partial-build path carries the same risk as 3.x This also raises a question about whether the default for Java ≥ 23 / no-processor projects should include What this PR documents The Javadoc clarification here is accurate: We also updated the disclaimer to remove a mention of This comment was generated by an AI agent, Hermès on behalf of @gnodet. |
|
Addressing @desruisseaux's three outstanding concerns from the CHANGES_REQUESTED review: 1. "IDE-style" vagueness (discussion_r4093688569 and r4093738732) Replaced the binary "not an incremental compiler in the sense of an IDE" with the more nuanced wording @desruisseaux proposed: "not yet as reliable as the incremental compilation provided by some IDEs" + an explicit note that future versions may add dependency tracking. This is accurate (some IDEs do use timestamps), forward-looking, and avoids a false binary. 2. "module" → "sub-project" (discussion_r4093703602) Applied to both 3. Deprecated param verbosity + "never" (discussion_r4093738732) Trimmed the Proposed diff (I can't push to this branch since it's on apache directly): - * <strong>Despite the word "incremental" in the name, this is <em>not</em> an incremental compiler
- * in the sense of an IDE.</strong> The plugin does not compile a single changed class and the classes
- * that depend on it. It selects a strategy to <i>detect changes</i> and decide whether
- * to recompile the whole module or only some source files. In the default configuration (no annotation
+ * <strong>Despite the word "incremental" in the name, this is not yet as reliable as the incremental
+ * compilation provided by some IDEs.</strong> It provides an approximation based on the timestamps of
+ * source files. The current algorithms detect only direct changes — recompiling only modified source files —
+ * but a future version may add an option for tracking classes that depend on a modified class, as done by
+ * some IDEs. It selects a strategy to <i>detect changes</i> and decide whether
+ * to recompile the whole sub-project or only some source files. In the default configuration (no annotation- * Whether to enable/disable the change detection that decides when to recompile the module.
- * Despite the word "incremental", this does not enable an
- * incremental compiler in the sense of an IDE. The plugin never compiles a single changed class
- * together with the classes that depend on it. It only detects changes and, depending on the
- * configuration, recompiles the whole module or only the modified source files.
+ * Whether to enable/disable the change detection that decides when to recompile the sub-project.
+ * Despite the word "incremental", this does not yet provide the same reliability as the incremental
+ * compilation provided by some IDEs. It only detects changes based on timestamps and, depending on
+ * the configuration, recompiles the whole sub-project or only the modified source files.This comment was generated by an AI agent, Hermès on behalf of @gnodet. |
…oject, trim deprecated Javadoc Three changes in response to the CHANGES_REQUESTED review: 1. Replace 'not an incremental compiler in the sense of an IDE' with desruisseaux's proposed nuanced wording: 'not yet as reliable as the incremental compilation provided by some IDEs' + explicit note that future versions may add dependency tracking. More accurate: some IDEs also use timestamps; the distinction is one of reliability, not category. 2. Replace 'recompile the whole module' -> 'recompile the whole sub-project' in both incrementalCompilation and useIncrementalCompilation Javadoc. 'module' is ambiguous between a Maven sub-project and a JPMS module. 3. Trim the useIncrementalCompilation (deprecated) paragraph from 5 lines to 4. Remove 'never compiles a single changed class' — too absolute for a deprecated parameter whose behaviour is already described by the @deprecated tag. Replace with the shorter timestamp-based description.
|
While working on this PR, we did a deeper analysis of what 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 Since this parameter was introduced in 4.x (still in beta), and compatibility was already broken when going from the 3.x boolean
We would be happy to expand the scope of this PR to include the rename if there is consensus on a name. Thoughts? @desruisseaux |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit b4eb9846 — "Address @desruisseaux review: nuance IDE-style wording, module→sub-project, trim deprecated Javadoc".
All 3 items from @desruisseaux's CHANGES_REQUESTED are now addressed:
- ✅ "IDE-style" vagueness — replaced with "not yet as reliable as the incremental compilation provided by some IDEs" + forward-looking note about potential dependency tracking. Adopts @desruisseaux's proposed nuance.
- ✅ "module" → "sub-project" — applied consistently in both
incrementalCompilation(line 596) anduseIncrementalCompilation(line 683, 686). No JPMS ambiguity remains. - ✅ Deprecated param verbosity + "never" — trimmed from 5 lines to 4. The absolute "never compiles a single changed class" sentence is gone, replaced with the timestamp-based description.
Documentation is factually accurate and ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit b4eb9846 — "Address @desruisseaux review: nuance IDE-style wording, module→sub-project, trim deprecated Javadoc".
All three @desruisseaux CHANGES_REQUESTED items are addressed:
- ✅ "IDE-style" vagueness — replaced binary "not an incremental compiler in the sense of an IDE" with nuanced "not yet as reliable as the incremental compilation provided by some IDEs" + forward-looking note about future dependency tracking. Accurate and appropriately hedged.
- ✅ "module" → "sub-project" — applied consistently in both
incrementalCompilationanduseIncrementalCompilationJavadoc. - ✅ Deprecated param verbosity + "never" —
useIncrementalCompilationtrimmed from 5 to 4 lines, absolute "never compiles a single changed class" removed. Wording is now timestamp-focused and proportionate for a deprecated parameter.
No new issues introduced. Documentation is factually accurate and ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
No objection to renaming the field. All proposed names ( |
Improves the documentation for the
incrementalCompilationparameter and the deprecateduseIncrementalCompilationparameter (issue #777, [MCOMPILER-563]).The name "incremental compilation" gives the misleading impression that the plugin compiles a single changed class together with its dependents, like an IDE incremental compiler. In reality the plugin only runs a change-detection algorithm that decides whether to recompile the whole module or only the modified source files.
This is a documentation-only change (Javadoc). No Java code behavior is modified. The updated Javadoc is what gets rendered into the plugin's published parameter documentation (plugin-info
.html).Closes #777