File tree 1 file changed +6
-2
lines changed
plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ open class GatherLicenseTask @Inject constructor(
484
484
)
485
485
continue
486
486
}
487
- if (! file.endsWith( " . jar" ) ) {
487
+ if (file.extension != " jar" ) {
488
488
logger.debug(
489
489
" File {} for artifact {} does not look like a JAR. Will skip MANIFEST.MF check" ,
490
490
file,
@@ -500,7 +500,11 @@ open class GatherLicenseTask @Inject constructor(
500
500
)
501
501
JarFile (file).use { jar ->
502
502
val bundleLicense = jar.manifest.mainAttributes.getValue(" Bundle-License" )
503
- val license = bundleLicense?.substringBefore(" ;" )?.let {
503
+ if (bundleLicense == null || bundleLicense.startsWith(" http://" ) || bundleLicense.startsWith(" https://" )) {
504
+ // Ignore URLs here as it will fail during parsing
505
+ return
506
+ }
507
+ val license = bundleLicense.substringBefore(" ;" )?.let {
504
508
licenseExpressionParser.parse(it)
505
509
}
506
510
if (license != null ) {
You can’t perform that action at this time.
0 commit comments