diff --git a/pom.xml b/pom.xml index 978fc3af8..941dfc24b 100644 --- a/pom.xml +++ b/pom.xml @@ -215,12 +215,6 @@ under the License. 3.3.4 - - org.apache.commons - commons-lang3 - 3.12.0 - - org.apache.commons commons-collections4 diff --git a/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java b/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java index e85c0388c..248bef790 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -53,7 +52,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { if (ancestors.isEmpty()) { getLog().info("No Ancestor POMs!"); } else { - getLog().info(String.format(Locale.US, "Ancestor POMs: %s", StringUtils.join(ancestors, " <- "))); + getLog().info("Ancestor POMs: " + String.join(" <- ", ancestors)); } } diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java index 00186de95..fe6e19c3e 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.plugin.AbstractMojo; @@ -40,6 +39,7 @@ import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis; import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer; import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerException; +import org.apache.maven.shared.utils.StringUtils; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.context.Context; @@ -512,7 +512,8 @@ private void writeDependencyXML(Set artifacts) { writer.endElement(); writer.startElement("version"); writer.writeText(artifact.getBaseVersion()); - if (!StringUtils.isBlank(artifact.getClassifier())) { + String classifier = artifact.getClassifier(); + if (StringUtils.isNotBlank(classifier)) { writer.startElement("classifier"); writer.writeText(artifact.getClassifier()); writer.endElement(); @@ -541,7 +542,6 @@ private void writeScriptableOutput(Set artifacts) { // called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961 artifact.isSnapshot(); - // CHECKSTYLE_OFF: LineLength buf.append(scriptableFlag) .append(":") .append(pomFile) @@ -554,7 +554,6 @@ private void writeScriptableOutput(Set artifacts) { .append(":") .append(artifact.getScope()) .append(System.lineSeparator()); - // CHECKSTYLE_ON: LineLength } getLog().info(System.lineSeparator() + buf); } diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java index 63acc3e3a..21e8cce3b 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java @@ -18,7 +18,6 @@ */ package org.apache.maven.plugins.dependency.resolvers; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -30,13 +29,11 @@ * @author Brian Fox * @since 2.0-alpha2 */ -// CHECKSTYLE_OFF: LineLength @Mojo( name = "sources", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true) -// CHECKSTYLE_ON: LineLength public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo { private static final String SOURCE_CLASSIFIER = "sources"; @@ -48,7 +45,7 @@ public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo { */ @Override protected void doExecute() throws MojoExecutionException { - if (StringUtils.isEmpty(this.classifier)) { + if (this.classifier == null || this.classifier.isEmpty()) { this.classifier = SOURCE_CLASSIFIER; }