This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
The following commit(s) were added to refs/heads/master by this push: new eceab09f [MDEP-952] Partially decouple AbstractFromConfigurationMojo from StringUtils (#487) eceab09f is described below commit eceab09fa0616bf8500e70c4d7726de7319670e6 Author: Elliotte Rusty Harold <elh...@users.noreply.github.com> AuthorDate: Sun Nov 24 14:57:46 2024 +0000 [MDEP-952] Partially decouple AbstractFromConfigurationMojo from StringUtils (#487) * somewhat Decouple AbstractFromConfigurationMojo from StringUtils --- .../fromConfiguration/AbstractFromConfigurationMojo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java index 770f86c2..90ba8818 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java @@ -164,13 +164,14 @@ public abstract class AbstractFromConfigurationMojo extends AbstractDependencyMo artifactItem.getOutputDirectory().mkdirs(); // make sure we have a version. - if (StringUtils.isEmpty(artifactItem.getVersion())) { + if (artifactItem.getVersion() == null || artifactItem.getVersion().isEmpty()) { fillMissingArtifactVersion(artifactItem); } artifactItem.setArtifact(this.getArtifact(artifactItem)); - if (StringUtils.isEmpty(artifactItem.getDestFileName())) { + if (artifactItem.getDestFileName() == null + || artifactItem.getDestFileName().length() == 0) { artifactItem.setDestFileName(DependencyUtil.getFormattedFileName( artifactItem.getArtifact(), removeVersion, prependGroupId, useBaseVersion, removeClassifier)); } @@ -185,7 +186,7 @@ public abstract class AbstractFromConfigurationMojo extends AbstractDependencyMo } private boolean checkIfProcessingNeeded(ArtifactItem item) throws MojoExecutionException, ArtifactFilterException { - return StringUtils.equalsIgnoreCase(item.getOverWrite(), "true") + return "true".equalsIgnoreCase(item.getOverWrite()) || getMarkedArtifactFilter(item).isArtifactIncluded(item); } @@ -216,6 +217,7 @@ public abstract class AbstractFromConfigurationMojo extends AbstractDependencyMo coordinate.setClassifier(artifactItem.getClassifier()); final String extension; + ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler(artifactItem.getType()); if (artifactHandler != null) { extension = artifactHandler.getExtension();