gnodet opened a new pull request, #1162: URL: https://github.com/apache/maven-compiler-plugin/pull/1162
## Summary Adds a dependency-graph-driven incremental compilation engine (`graph` strategy) alongside the existing timestamp-based strategy. Based on #1158. - **Class-level dependency tracking**: After each compilation pass, bytecode is analyzed to build a class-level dependency graph. When a source file changes, only the source files that transitively depend on any of its classes are recompiled. - **Content hashing with mtime short-circuit**: Source changes are detected via SHA-256 content hashing, with an mtime-first optimization to skip hashing unchanged files. - **Multi-release JAR**: Bytecode analysis uses the `java.lang.classfile` API (JDK 24+) via multi-release JAR infrastructure from #1158. Falls back to `timestamp` strategy on older JDKs. - **Full JPMS support**: Tracks `module-info.java`, detects module name changes (triggering full rebuild), supports module-prefixed output directories. - **External classpath tracking**: JAR classpath entries are tracked by size+mtime. Changed JARs trigger recompilation of source files that reference external types. - **Annotation processor cascade**: When annotation processors are present and compiled sources contain annotations, all sources are conservatively recompiled. - **State persistence**: Incremental state is stored in `target/maven-status/maven-compiler-plugin/<outputDirName>/incremental-state`, outside the class output directory. This is **step 1 of 4** splitting [#1157](https://github.com/apache/maven-compiler-plugin/pull/1157) into focused PRs, per the review feedback at https://github.com/apache/maven-compiler-plugin/pull/1144#issuecomment-5984536369: 1. **Dependency graph** (this PR) — based on #1158 2. Intra-module ABI fingerprinting 3. Cross-module ABI manifest 4. Annotation processor classification ## Test plan - [x] Unit tests for `BytecodeAnalyzer`, `IncrementalState`, `GraphIncrementalBuild` (all pass on JDK 21; JDK 24+ tests require runtime with `java.lang.classfile`) - [x] Compilation succeeds with `mvn clean verify -B` - [ ] Integration tests with JDK 24+ runtime 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
