From 9ad7c7adcb19eb10980f056dc6816f8f7a373296 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Fri, 6 Sep 2024 15:09:02 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"Enhance=20exception=20handling=20for?= =?UTF-8?q?=20license=20execution=20when=20the=20URL=20tag=20of=20?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a6b82ffd99af8abe11d70699abc48e0ece1d9469. --- .../codehaus/mojo/license/AbstractDownloadLicensesMojo.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java b/src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java index 2b647120d..0f558882c 100644 --- a/src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java +++ b/src/main/java/org/codehaus/mojo/license/AbstractDownloadLicensesMojo.java @@ -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; @@ -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);