You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update PR description to clarify validation-time only storage
- Clarified that we store ONLY validation-time values (not both)
- Removed fallback logic from code examples
- Added table showing what gets stored vs. logged
- Fixed alternatives section - removed contradiction
- Changed exception type to AssertionError for programming bugs
Copy file name to clipboardExpand all lines: PR_DESCRIPTION.md
+31-23Lines changed: 31 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,48 +49,47 @@ The problem: **validation reads BEFORE injection, storage reads AFTER injection*
49
49
50
50
## Solution
51
51
52
-
Capture properties at **validation time** for ALL builds (even when no cache exists). This ensures both validation and storage read at the same lifecycle point.
52
+
Capture properties at **validation time** for ALL builds (even when no cache exists). Store ONLY validation-time values in the cache. This ensures both validation and storage read at the same lifecycle point.
53
53
54
54
### Implementation
55
55
56
56
1.**Modified `CacheResult`** to store validation-time mojo events
57
57
2.**Modified `BuildCacheMojosExecutionStrategy`** to capture properties immediately after `findCachedBuild()`
58
-
3.**Modified `save()`** to use validation-time events instead of execution-time events
58
+
3.**Modified `save()`** to store ONLY validation-time events (fails with `AssertionError` if missing)
59
59
60
60
### Key Code Changes
61
61
62
62
```java
63
63
// In BuildCacheMojosExecutionStrategy.execute():
64
64
result = cacheController.findCachedBuild(session, project, mojoExecutions, skipCache);
65
65
66
-
// NEW: Capture validation-time properties for ALL mojos
**Note:** Execution-time values are still captured by `MojoParametersListener` for logging/debugging during the build, but are NOT stored in the cache.
84
+
86
85
### New Timeline (Both Builds)
87
86
88
87
```
89
88
First Build:
90
89
1. findCachedBuild() → no cache
91
90
2. captureValidationTimeProperties() → reads WITHOUT injection
92
-
3. Mojos execute → Maven 4 injects (but we don't use these values)
93
-
4. save() uses validation-time properties → stores WITHOUT injection
91
+
3. Mojos execute → Maven 4 injects (logged but not stored)
92
+
4. save() stores ONLY validation-time properties → WITHOUT injection
94
93
95
94
Second Build:
96
95
1. findCachedBuild() → cache found
@@ -99,6 +98,15 @@ Second Build:
99
98
4. Compares to first build → BOTH without injection → MATCH!
0 commit comments