Skip to content

Commit

Permalink
Revert "Enhance exception handling for license execution when the URL…
Browse files Browse the repository at this point in the history
… tag of …"

This reverts commit a6b82ff.
  • Loading branch information
slawekjaranowski authored Sep 6, 2024
1 parent a6b82ff commit f91925c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
Expand Down Expand Up @@ -1277,11 +1276,11 @@ private void downloadLicenses(

int licenseIndex = 0;
for (ProjectLicense license : licenses) {
if (matchingUrlsOnly && StringUtils.isNotBlank(license.getUrl())) {
if (matchingUrlsOnly && license.getUrl() == null) {
handleError(
depProject,
"No URL for license at index " + licenseIndex + " in dependency " + depProject.toGavString());
} else if (StringUtils.isNotBlank(license.getUrl())) {
} else if (license.getUrl() != null) {
final String licenseUrl = urlReplacements.rewriteIfNecessary(license.getUrl());

final LicenseDownloadResult cachedResult = cache.get(licenseUrl);
Expand Down

0 comments on commit f91925c

Please sign in to comment.