gnodet opened a new pull request, #1152: URL: https://github.com/apache/maven-compiler-plugin/pull/1152
## Summary Add an ABI-fingerprint-based incremental compilation strategy as an alternative to the existing timestamp strategy. The new strategy tracks the public API surface of each compiled type and only recompiles consumers whose dependency's ABI actually changed — method body changes do not cascade. Depends on #1151 (MRJAR infrastructure for bytecode analyzer). ## Usage ```xml <maven.compiler.incrementalStrategy>abi</maven.compiler.incrementalStrategy> ``` Or via CLI: `-Dmaven.compiler.incrementalStrategy=abi` Default remains `timestamp` (existing behavior unchanged). ## Core Engine - **AbiIncrementalBuild**: orchestrates the incremental build cycle — initializes from persisted state, determines what to compile, runs post-compilation bytecode analysis, cascades on ABI changes, persists state - **IncrementalState**: binary-serialized persistent state — per-source-file content hashes + mtimes, per-type metadata (ABI fingerprint, signature deps, implementation deps, annotation types, module name), external fingerprints, classpath identities - **SourceFileAnalysis**: per-type analysis record produced by bytecode analysis - **ExternalAbiResolver**: resolves ABI fingerprints for types from other reactor modules or external JARs (manifest → reactor → bytecode fallback with JAR caching) - **AbiManifest**: cross-module fingerprint manifest read/write for downstream reactor modules - **ProcessorClassification + ProcessorType**: annotation processor cascade classification (isolating/aggregating/unknown, compatible with Gradle's taxonomy) ## Mojo Integration - `AbstractCompilerMojo.incrementalStrategy`: new parameter (values: `timestamp`, `abi`) - `ToolExecutor.compileWithAbiIncremental()`: full lifecycle — classpath collection, processor path setup, config hashing, compile loop with ABI cascade - `ToolExecutorForTest`: ABI override for test module output ## Tests - `AbiIncrementalBuildTest`: full build, incremental, source changes, deletion, cascade, processor classification, config changes, JPMS - `IncrementalStateTest`: serialization roundtrip, consumer lookup, source→type indexing - `AbiManifestTest`: write/read, empty file, version check - `ExternalAbiResolverTest`: manifest resolution, bytecode fallback, JAR caching - `ProcessorClassificationTest`: META-INF descriptor parsing, classification logic ## Integration Tests - `abi-incremental-basic`: body-only change → only the changed file is recompiled - `abi-incremental-cascade`: ABI change (new public method) → cascades to consumers Part 2 of 3: MRJAR infrastructure (#1151) → **ABI strategy** → ABI refinements. -- 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]
