From b334e33c72b9cf55a38cdab2ee5897a0e5979172 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 25 Apr 2024 19:07:03 +0200 Subject: [PATCH 1/3] [MRESOLVER-547] Just use setVersion No need for full copy, Artifact is already immutable. Moreover, the instance may be not DefaultArtifact but something else. And finally, setVersion already have "optimization" to return this if version is same as the one we want to copy with. --- https://issues.apache.org/jira/browse/MRESOLVER-547 --- .../impl/collect/bf/BfDependencyCollector.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/bf/BfDependencyCollector.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/bf/BfDependencyCollector.java index 68a417579..85d267e9c 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/bf/BfDependencyCollector.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/bf/BfDependencyCollector.java @@ -45,8 +45,6 @@ import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.artifact.ArtifactType; -import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.CollectRequest; import org.eclipse.aether.collection.DependencyManager; import org.eclipse.aether.collection.DependencySelector; @@ -431,14 +429,7 @@ private void resolveArtifactDescriptorAsync(Args args, DependencyProcessingConte private ArtifactDescriptorResult resolveDescriptorForVersion( Args args, DependencyProcessingContext context, Results results, Dependency dependency, Version version) { Artifact original = dependency.getArtifact(); - Artifact newArtifact = new DefaultArtifact( - original.getGroupId(), - original.getArtifactId(), - original.getClassifier(), - original.getExtension(), - version.toString(), - original.getProperties(), - (ArtifactType) null); + Artifact newArtifact = original.setVersion(version.toString()); Dependency newDependency = new Dependency(newArtifact, dependency.getScope(), dependency.isOptional(), dependency.getExclusions()); DependencyProcessingContext newContext = context.copy(); From da8e17bd180a6bccaf99c4892536bba8de85b375 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 25 Apr 2024 19:12:55 +0200 Subject: [PATCH 2/3] Update workflow --- .github/workflows/maven-verify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index e160fa904..7943e614c 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -24,9 +24,10 @@ on: jobs: build: name: Verify - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3 + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4 with: ff-site-run: false maven-matrix: '[ "3.9.6" ]' + jdk-distribution-matrix: '[ "zulu" ]' From d162aeeb845ce9a28d79b4ce96deea7453b5eb6f Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 25 Apr 2024 19:20:27 +0200 Subject: [PATCH 3/3] Remove workaround --- .github/workflows/maven-verify.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index 7943e614c..41144f5e4 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -28,6 +28,5 @@ jobs: with: ff-site-run: false maven-matrix: '[ "3.9.6" ]' - jdk-distribution-matrix: '[ "zulu" ]'