This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/maven-build-cache-extension.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ed80534 Replace deprecated MavenProject.addAttachedArtifact with 
MavenProjectHelper.attachArtifact (#562)
0ed80534 is described below

commit 0ed8053418a27644916464a524e4c73abca2fb1d
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Tue Oct 27 15:09:33 2026 -0400

    Replace deprecated MavenProject.addAttachedArtifact with 
MavenProjectHelper.attachArtifact (#562)
---
 .../java/org/apache/maven/buildcache/CacheControllerImpl.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java 
b/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
index 86f9473d..f33f514d 100644
--- a/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
+++ b/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
@@ -487,7 +487,13 @@ public ArtifactRestorationReport 
restoreProjectArtifacts(CacheResult cacheResult
                     project.addLifecyclePhase("package");
                 }
             }
-            restoredAttachedArtifacts.forEach(project::addAttachedArtifact);
+            for (org.apache.maven.artifact.Artifact attachedArtifact : 
restoredAttachedArtifacts) {
+                projectHelper.attachArtifact(
+                        project,
+                        attachedArtifact.getType(),
+                        attachedArtifact.getClassifier(),
+                        attachedArtifact.getFile());
+            }
             restorationReport.setSuccess(true);
         } catch (Exception e) {
             LOGGER.debug("Cannot restore cache, continuing with normal 
build.", e);

Reply via email to