I need to get a list of all dependencies and their licenses.
I’ve tried a couple of plugins thus far but they are in various states of not working…
It seems like my best option might be to generate the maven pom.xml and call the maven license plugin…
Any suggestions?
Issue
The problem is that plugin (hierynomus/license-gradle-plugin) by default takes dependency configuration that is not resolvable. There are some issues opened in the github repository.
It seems latest Gradle version or this plugin version broke something. I expect a solution soon..
Here is the topic about resolvable dependencies in Gradle documentation
Solution
A workaround to get your report is following.
Exmaple of the build script below (in Groovy)
/**
* Apply licence report plugin.
*/
plugins {
id "com.github.hierynomus.license-report" version"0.16.1"
}
/**
* You will have to specify for which configuration dependencies should be resolved.
* Note check in Gradle documentation about configuration types that can be resolved.
* https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs
*
* Following are resolvable by default:
* - compileClasspath
* - runtimeClasspath
*/
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
// or
// dependencyConfiguration = 'compileClasspath'
}
After the execution reports should be located at build/reports/licence
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With