Commit 91e8b9c
committed
Fix timestamp preservation when extracting cached files
The build cache extension was not properly preserving file and directory
timestamps when restoring attachedOutputs from cache. This caused Maven
to warn about files being 'more recent than the packaged artifact' even
after a successful build.
Root Causes:
1. The zip() method did not store directory entries with timestamps
2. The unzip() method set directory timestamps immediately, but they
were later modified by Files.copy() operations for files within
Changes:
- Modified CacheUtils.zip() to store directory entries with timestamps
via preVisitDirectory() callback
- Modified CacheUtils.unzip() to defer directory timestamp updates until
after all files are extracted, preventing them from being overwritten
- Added Map<Path, Long> to track directory timestamps during extraction
This ensures that cached build outputs maintain their original timestamps,
preventing spurious warnings and improving build cache consistency.1 parent 5990c9f commit 91e8b9c
1 file changed
+30
-3
lines changedLines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
168 | 182 | | |
169 | 183 | | |
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
173 | 187 | | |
174 | 188 | | |
| 189 | + | |
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
| |||
185 | 200 | | |
186 | 201 | | |
187 | 202 | | |
| 203 | + | |
188 | 204 | | |
189 | 205 | | |
190 | 206 | | |
| |||
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
196 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
197 | 216 | | |
198 | 217 | | |
199 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
200 | 221 | | |
| 222 | + | |
201 | 223 | | |
202 | | - | |
203 | 224 | | |
204 | 225 | | |
205 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
206 | 233 | | |
207 | 234 | | |
208 | 235 | | |
| |||
0 commit comments