go-license-discovery
The license discovery is a library and set of tools
that can analyze license text to determine what type of license it contains.
It searches for license texts in a file and compares them to an archive of known licenses
This library encapsulate logic from 2 best licenses detection libraries :
In Addition this library uses :
- checksum based cache to have better performance detection of licenses which already been met
- analyzed pom file to detect licenses which presented in the pom as a comment
Example :
copy licenses.db (located under matcher/licenses/licenses.db) file to <licenses folder>
matcher.InitLicenseMatcher(<licenses folder>)
- Match licenses txt file to a known spdx licenses.
matcher.MatchLicenseTxt(licenseTxt)
- Read License from pom file comments and match it to a known spdx licenses.
matcher.GetPomCommentLicense(pomFile)