Skip to content

Commit

Permalink
Fix license not detected for some maven packages
Browse files Browse the repository at this point in the history
In one of the workflow, scancode summarizer goes through the root files
to look for license.  The filtering for root files is based on case
sensitive file path matching.  In maven packaging, META/INF directory
is used often.  Add this to the license location to search.

Test case:
https://clearlydefined.io/definitions/maven/mavencentral/org.flywaydb/flyway-core/9.20.0
https://dev.clearlydefined.io/definitions/maven/mavencentral/org.flywaydb/flyway-core/7.7.2

Task: #846
  • Loading branch information
qtomlinson committed Oct 10, 2023
1 parent c9ea150 commit 5a68d1f
Show file tree
Hide file tree
Showing 3 changed files with 1,545 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ function isDeclaredLicense(identifier) {
}

function getLicenseLocations(coordinates) {
const map = { npm: ['package/'], maven: ['meta-inf/'], pypi: [`${coordinates.name}-${coordinates.revision}/`], go: [goLicenseLocations(coordinates)] }
const map = {
npm: ['package/'],
maven: ['meta-inf/', 'META-INF/'],
pypi: [`${coordinates.name}-${coordinates.revision}/`],
go: [goLicenseLocations(coordinates)]
}
return map[coordinates.type]
}

Expand Down
Loading

0 comments on commit 5a68d1f

Please # to comment.