I have small task that prints for each configuration the dependencies including their version using allDependencies
on a configuration
. This works great for all compile
or test compile
dependencies such as:
compile "com.google.guava:guava:22.0"
testCompile "junit:junit:4.12"
Unfortunately, it fails for local dependencies using compile files
such as:
compile files("/path/to/jar.jar")
The task does not even list the local dependencies using allDependencies
. To retrieve the version information, one would obviously have to specify it first.
Is it possible to set up the local dependencies in such a way that they are listed using allDependencies
, and to specify the version info without manually setting up a local repository as described in How to use sources / javadoc of local compile dependency in Eclipse / Buildship?
Here is the task:
task printDependencies {
project.configurations.each {conf ->
println conf
conf.allDependencies.each {dep ->
println "${dep.name}=${dep.version}"
}
println ""
}
}