Closed wzieba closed 9 months ago
A possible solution is to additionally set a filter, like
- name: Extract the 'runtimeClasspath' dependencies
run: ./gradlew dependencies --configuration runtimeClasspath
env:
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: runtimeClasspath
You're right. The documentation is a bit inaccurate.
Without an explicit filter, the dependency-graph
file will contain all dependencies resolved as part of the build execution. The reason you're seeing Detekt
and Kotlin
dependencies is because these have to be resolved in order to configure your build and applied plugins.
I'll update the documentation to remove the --configuration
filter, to avoid this confusion.
Issue
When using a dedicated workflow for dependency graph generation as described here, the generated dependency graph contains dependencies from all the configurations, instead of only the requested one.
Reproduction
I've prepared MRE here: https://github.com/wzieba/GradleBuildActionTest
The
detekt
plugin is just an example of some build plugin.Having a Gradle project
In such project, the result of
dependencies --configuration runtimeClasspath
isThen, with GitHub Action
Expected result
I expect that the generated
dependency-graph
file will contain onlyjavax.inject:javax.inject:1
dependency (and its transitive dependencies if any).Current result
The generated
dependency-graph
(link) contains all project dependencies, includingDetekt
andKotlin
(transitive dependency ofDetekt
)