mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.66k stars 423 forks source link

Some Licenses have empty licenseContent, and some also wrong url #1007

Closed sergio-sastre closed 2 months ago

sergio-sastre commented 3 months ago

About this issue

I've seen the following licenses have empty license content, some also with the wrong Url: License returned url right url
CDDL + GPLv2 with classpath exception https://github.com/javaee/javax.annotation/blob/master/LICENSE same as returned url
Bouncy Castle Licence https://www.bouncycastle.org/licence.html same as returned url
Eclipse Public License - Version 2.0 https://www.eclipse.org/legal/epl-2.0 same as returned url
Eclipse Public License v2.0 https://www.eclipse.org/legal/epl-v20.html same as returned url
Android Software Development Kit License: url https://developer.android.com/studio/terms.html same as returned url
Unicode/ICU License https://raw.githubusercontent.com/unicode-org/icu/main/icu4c/LICENSE https://github.com/unicode-org/icu?tab=License-1-ov-file

I'd expect those licenses to return the content of the returned urls

Details

mikepenz commented 3 months ago

Thank you for the report.

By default the action will only resolve licenses that will be identified to their SPDX identifiers. (Specifically SPDX Identifiers v1)

There is however a built in function which uses GitHubs License API to retrieve the license content more correctly.

You can enable it by doing:

aboutLibraries {
    fetchRemoteLicense = true
}

Please keep in mind that this uses the GitHub API so a gitHubApiToken is advised to also be provided to not hit a rate limit. And all of that is best paired disabling the registerAndroidTasks and running and generating the file in a CI step or on demand. (So your team does not have to also configure a GitHub token / or it won't change when you don't want it to)

aboutLibraries {
    registerAndroidTasks = true
}

E.g. running it for example like:

./gradlew app-desktop:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources/
mikepenz commented 3 months ago

https://github.com/mikepenz/AboutLibraries/pull/1009/commits/23497da22bd993516d461873d619b44e3dbff9b2

mikepenz commented 2 months ago

Were you able to resolve the problem enabling fetchRemoteLicense=true?

sergio-sastre commented 2 months ago

Sorry for not replying before. So we decided to handle such licenses manually for now.

I’m sure we’ll revisit this again in 1-2 months, but currently there are other tasks with higher priority.

I’ll let you know whenever we try this out but I think it won’t be soon 😅

mikepenz commented 2 months ago

Thanks for the response. Will close this for now in that case. Feel free to re-open at a later point