From 8382743ceaf55dc1f4695e12ed8d3a1e2917a2c9 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sat, 16 Apr 2022 20:35:47 +0200 Subject: [PATCH] [MSITE-884] Drop/replace usage of Commons Lang 3 --- pom.xml | 6 ------ .../maven/plugins/site/deploy/AbstractStagingMojo.java | 2 +- .../maven/plugins/site/deploy/SiteStageDeployMojo.java | 2 +- .../maven/plugins/site/descriptor/EffectiveSiteMojo.java | 5 +---- .../org/apache/maven/plugins/site/deploy/HttpRequest.java | 8 +++----- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 338988d8..dbf8e2cf 100644 --- a/pom.xml +++ b/pom.xml @@ -486,12 +486,6 @@ under the License. test - - org.apache.commons - commons-lang3 - 3.8.1 - - commons-io commons-io diff --git a/src/main/java/org/apache/maven/plugins/site/deploy/AbstractStagingMojo.java b/src/main/java/org/apache/maven/plugins/site/deploy/AbstractStagingMojo.java index f51e9eb4..7070b530 100644 --- a/src/main/java/org/apache/maven/plugins/site/deploy/AbstractStagingMojo.java +++ b/src/main/java/org/apache/maven/plugins/site/deploy/AbstractStagingMojo.java @@ -19,10 +19,10 @@ * under the License. */ -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; +import org.apache.maven.shared.utils.StringUtils; /** * Abstract base class for staging mojos. diff --git a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageDeployMojo.java b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageDeployMojo.java index 173c5025..e31c7513 100644 --- a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageDeployMojo.java +++ b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageDeployMojo.java @@ -20,7 +20,6 @@ */ import java.util.Map; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.model.Build; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginManagement; @@ -30,6 +29,7 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; +import org.apache.maven.shared.utils.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; /** diff --git a/src/main/java/org/apache/maven/plugins/site/descriptor/EffectiveSiteMojo.java b/src/main/java/org/apache/maven/plugins/site/descriptor/EffectiveSiteMojo.java index 879a5b6f..556f6bfb 100644 --- a/src/main/java/org/apache/maven/plugins/site/descriptor/EffectiveSiteMojo.java +++ b/src/main/java/org/apache/maven/plugins/site/descriptor/EffectiveSiteMojo.java @@ -19,7 +19,6 @@ * under the License. */ -import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Writer; import org.apache.maven.plugin.MojoExecutionException; @@ -117,9 +116,7 @@ protected static void writeHeader( XMLWriter writer ) { XmlWriterUtil.writeCommentLineBreak( writer ); XmlWriterUtil.writeComment( writer, " " ); - // Use ISO 8601 format for date and time - String formattedDateTime = DateFormatUtils.ISO_DATETIME_FORMAT.format( System.currentTimeMillis() ); - XmlWriterUtil.writeComment( writer, "Generated by Maven Site Plugin on " + formattedDateTime ); + XmlWriterUtil.writeComment( writer, "Generated by Maven Site Plugin" ); XmlWriterUtil.writeComment( writer, "See: http://maven.apache.org/plugins/maven-site-plugin/" ); XmlWriterUtil.writeComment( writer, " " ); XmlWriterUtil.writeCommentLineBreak( writer ); diff --git a/src/test/java/org/apache/maven/plugins/site/deploy/HttpRequest.java b/src/test/java/org/apache/maven/plugins/site/deploy/HttpRequest.java index b1491a4f..b7d5cd8f 100644 --- a/src/test/java/org/apache/maven/plugins/site/deploy/HttpRequest.java +++ b/src/test/java/org/apache/maven/plugins/site/deploy/HttpRequest.java @@ -19,8 +19,6 @@ * under the License. */ -import org.apache.commons.lang3.SystemUtils; - import java.util.HashMap; import java.util.Map; @@ -41,12 +39,12 @@ class HttpRequest public String toString() { StringBuilder sb = new StringBuilder( method ).append( " path " ).append( path ) - .append( SystemUtils.LINE_SEPARATOR ); + .append( System.lineSeparator() ); for ( Map.Entry entry : headers.entrySet() ) { sb.append( entry.getKey() ).append( " : " ).append( entry.getValue() ) - .append( SystemUtils.LINE_SEPARATOR ); + .append( System.lineSeparator() ); } return sb.toString(); } -} \ No newline at end of file +}