This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
commit 3fd8743ed1bec72d341a66f0a24a153e054d49ca Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Sat Nov 14 20:38:49 2026 +0100 Copy the dependency list before filtering it in go-offline Maven 4's compatibility model can return a new Dependency wrapper on every iteration, so the identity map lost every entry and go-offline resolved no project dependencies. --- .../org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java index 5df9c6fd..44725a49 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java @@ -297,7 +297,10 @@ public class GoOfflineMojo extends AbstractDependencyFilterMojo { * Applies the artifact filters of this goal to the given dependencies. The original dependencies are returned, * not copies rebuilt from their coordinates, so their exclusions, optional flag and system path are kept. */ - private List<Dependency> filterDependencies(Collection<Dependency> deps) throws ArtifactFilterException { + private List<Dependency> filterDependencies(Collection<Dependency> dependencies) throws ArtifactFilterException { + // Copy first: on Maven 4 the model's lists can hand out a new wrapper on every iteration, which would defeat + // the identity map below. + List<Dependency> deps = new ArrayList<>(dependencies); Map<Dependency, Artifact> artifacts = new IdentityHashMap<>(); for (Dependency dep : deps) { artifacts.put(
