Gradle-License-Report icon indicating copy to clipboard operation
Gradle-License-Report copied to clipboard

Extracting the most accurate license

Open chkpnt opened this issue 4 years ago • 1 comments

I've just stumbled over the singleModuleLicenseInfo in LicenseDataCollector.groovy:

https://github.com/jk1/Gradle-License-Report/blob/c6d151054449e1f6b9de6899f5a28f853195e871/src/main/groovy/com/github/jk1/license/render/LicenseDataCollector.groovy#L24-L32

Shouldn't be firstOrNull(...) used for the extraction of the most accurate license?

For example:

From this license chain, I'd assume EDL being the most appropriate license when asking for a single license information about saaj-impl, and that's what displayed by mvnrepository.com, too. But singleModuleLicenseInfo(...) is returning GPLv2.

chkpnt avatar Jul 26 '21 16:07 chkpnt

Well... now I've read the next method, where you build the MultiLicenseInfo-object: My suggestion to use firstOrNull is wrong without further work ;-).

The issue in my example is that LICENSE.md included in com.sun.xml.messaging.saaj:saaj-impl:1.5.3 (which declares an EDLv1 license) isn't appended to info.license, as the license is already in the list: https://github.com/jk1/Gradle-License-Report/blob/c6d151054449e1f6b9de6899f5a28f853195e871/src/main/groovy/com/github/jk1/license/render/LicenseDataCollector.groovy#L64-L70

chkpnt avatar Jul 26 '21 17:07 chkpnt