You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2021/01/17 18:58:31 UTC

[maven-artifact-plugin] 01/01: prefer commons lang StringUtils to plexus

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

elharo pushed a commit to branch util2
in repository https://gitbox.apache.org/repos/asf/maven-artifact-plugin.git

commit 1d7cf18b82b820ef445f3a093d596e04481127da
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sun Jan 17 13:58:19 2021 -0500

    prefer commons lang StringUtils to plexus
---
 pom.xml                                                            | 5 +++++
 .../org/apache/maven/plugins/artifact/buildinfo/BuildinfoMojo.java | 7 ++++---
 .../org/apache/maven/plugins/artifact/buildinfo/MavenVersion.java  | 3 ++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3ec8e7d..53d3e77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,11 @@
       <version>3.3.3</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.8</version>
+    </dependency>
+    <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
       <version>1.15</version>
diff --git a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildinfoMojo.java b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildinfoMojo.java
index e962913..234fa3b 100644
--- a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildinfoMojo.java
+++ b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildinfoMojo.java
@@ -19,6 +19,8 @@ package org.apache.maven.plugins.artifact.buildinfo;
  * under the License.
  */
 
+import org.apache.commons.lang3.StringUtils;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
@@ -33,7 +35,6 @@ import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 import org.apache.maven.shared.utils.io.FileUtils;
 import org.apache.maven.shared.utils.logging.MessageUtils;
-import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.repository.RemoteRepository;
@@ -350,8 +351,8 @@ public class BuildinfoMojo
                 p.println( "version=" + project.getVersion() );
                 p.println( "ok=" + ok );
                 p.println( "ko=" + ko );
-                p.println( "okFiles=\"" + StringUtils.join( okFilenames.iterator(), " " ) + '"' ); 
-                p.println( "koFiles=\"" + StringUtils.join( koFilenames.iterator(), " " ) + '"' ); 
+                p.println( "okFiles=\"" + StringUtils.join( okFilenames, " " ) + '"' ); 
+                p.println( "koFiles=\"" + StringUtils.join( koFilenames, " " ) + '"' ); 
                 getLog().info( "Reproducible Build comparison saved to " + compare );
             }
             catch ( IOException e )
diff --git a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/MavenVersion.java b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/MavenVersion.java
index 9b22d72..3d37fdc 100644
--- a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/MavenVersion.java
+++ b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/MavenVersion.java
@@ -1,5 +1,7 @@
 package org.apache.maven.plugins.artifact.buildinfo;
 
+import org.apache.commons.lang3.StringUtils;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,7 +22,6 @@ package org.apache.maven.plugins.artifact.buildinfo;
  */
 
 import org.apache.maven.cli.MavenCli;
-import org.codehaus.plexus.util.StringUtils;
 
 import java.io.IOException;
 import java.io.InputStream;