Skip to content

Commit

Permalink
[MDEP-952] Partially decouple AbstractFromConfigurationMojo from Stri…
Browse files Browse the repository at this point in the history
…ngUtils (#487)

* somewhat Decouple AbstractFromConfigurationMojo from StringUtils
  • Loading branch information
elharo authored Nov 24, 2024
1 parent 8853304 commit eceab09
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsReque
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));
}
Expand All @@ -185,7 +186,7 @@ protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsReque
}

private boolean checkIfProcessingNeeded(ArtifactItem item) throws MojoExecutionException, ArtifactFilterException {
return StringUtils.equalsIgnoreCase(item.getOverWrite(), "true")
return "true".equalsIgnoreCase(item.getOverWrite())
|| getMarkedArtifactFilter(item).isArtifactIncluded(item);
}

Expand Down Expand Up @@ -216,6 +217,7 @@ protected Artifact getArtifact(ArtifactItem artifactItem) throws MojoExecutionEx
coordinate.setClassifier(artifactItem.getClassifier());

final String extension;

ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler(artifactItem.getType());
if (artifactHandler != null) {
extension = artifactHandler.getExtension();
Expand Down

0 comments on commit eceab09

Please sign in to comment.