From a272fb30877441fc2251d66013fd04e9baf92e8a Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Tue, 19 Nov 2024 06:39:16 -0500 Subject: [PATCH] Cut another dependency on commons-lang3 --- .../fromDependencies/TestCopyDependenciesMojo2.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java index f46370d28..cb852a1ec 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java @@ -26,7 +26,6 @@ import java.util.Collection; import java.util.Set; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadata; @@ -53,6 +52,7 @@ public class TestCopyDependenciesMojo2 extends AbstractDependencyMojoTestCase { private CopyDependenciesMojo mojo; + @Override protected void setUp() throws Exception { // required for mojo lookups to work super.setUp("copy-dependencies", true); @@ -272,7 +272,7 @@ private Artifact createExpandedVersionArtifact( snapshot.setBuildNumber(1); RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata(expandedSnapshot, snapshot); String newVersion = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber(); - expandedSnapshot.setResolvedVersion(StringUtils.replace(baseVersion, Artifact.SNAPSHOT_VERSION, newVersion)); + expandedSnapshot.setResolvedVersion(baseVersion.replace(Artifact.SNAPSHOT_VERSION, newVersion)); expandedSnapshot.addMetadata(metadata); return expandedSnapshot; }