Commit 70d91e7
Add default executionControl reconciliation for common Maven plugins
## Problem
Without executionControl configuration, the build cache does not track critical plugin properties that are often specified via command-line arguments (e.g., -Dmaven.compiler.release). This leads to incorrect cache reuse when these properties change between builds.
In multi-module JPMS projects, this manifests as compilation failures or bytecode version mismatches:
1. Build with `-Dmaven.compiler.release=17` → cache stores Java 17 bytecode (major version 61)
2. Build with `-Dmaven.compiler.release=21` → cache incorrectly reuses Java 17 bytecode
3. Result: Bytecode remains major version 61 instead of expected 65
This is particularly problematic for module-info.class files which are sensitive to Java version.
## Solution
Implemented default reconciliation configs for common plugins when executionControl is not specified:
- **maven-compiler-plugin** (compile & testCompile goals):
- Tracks `source`, `target`, and `release` properties
- Ensures cache invalidation when Java version changes
- **maven-install-plugin** (install goal):
- Tracked to ensure local repository is updated when needed
## Testing
Verified with multi-module JPMS test project:
**Before (broken):**
```
mvn clean verify -Dmaven.compiler.release=17 # Caches Java 17 bytecode
mvn clean verify -Dmaven.compiler.release=21 # Incorrectly reuses Java 17 bytecode
javap -v module-info.class | grep "major version" # Shows 61 (wrong!)
```
**After (fixed):**
```
mvn clean verify -Dmaven.compiler.release=17 # Caches Java 17 bytecode
mvn clean verify -Dmaven.compiler.release=21 # Detects change, recompiles
javap -v module-info.class | grep "major version" # Shows 65 (correct!)
```
## Impact
- Users no longer need to manually configure executionControl for basic scenarios
- Prevents silent bytecode version mismatches in JPMS projects
- Backward compatible: explicit executionControl config still takes precedence
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5990c9f commit 70d91e7
File tree
2 files changed
+67
-9
lines changed- src
- main/java/org/apache/maven/buildcache/xml
- site/markdown
2 files changed
+67
-9
lines changedLines changed: 56 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
| 251 | + | |
254 | 252 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
| |||
271 | 268 | | |
272 | 269 | | |
273 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
274 | 321 | | |
275 | 322 | | |
276 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
| |||
0 commit comments