When investigating e.g. the `runtimeClasspath` co...
# community-support
s
When investigating e.g. the
runtimeClasspath
configuration in a Kotlin build script, is it still possible to tell which of the JARs are direct dependencies, and which are transitive dependencies?
v
Depends on where and how you "investigate". What is your use-case?
s
I need to exclude some dependencies that are added by a plugin, but instead of excluding many transitive dependencies manually, I'd like to identify the smallest amount of parent dependencies to exclude.
v
You should probably report a bug to that plugin. 😄 So you only want to do that for investigating what you need to exclude? Then just check
dependencies
of the configuration
Copy code
configurations.testRuntimeClasspath.get().forEach { println("testRuntimeClasspath 1: $it") }
configurations.testImplementation.get().dependencies.forEach { println("testRuntimeClasspath 2: $it") }
=>
Copy code
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.spockframework\spock-core\2.3-groovy-4.0\8861b2590bb8e4709b052fb4ed6da3de98e734d9\spock-core-2.3-groovy-4.0.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.apache.groovy\groovy\4.0.26\1031daf8a73986def8b43c9bbf5d67671eb26553\groovy-4.0.26.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-engine\1.9.0\bd46891f01817b5ffdd368cb0482a34746610acb\junit-platform-engine-1.9.0.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-commons\1.9.0\b727889107fc28c7460b21d1083212f8ce7602c6\junit-platform-commons-1.9.0.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-launcher\1.9.0\367a24bb63baca99a181ea921da8e21af0656e7c\junit-platform-launcher-1.9.0.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar
testRuntimeClasspath 1: D:\Dateien\.gradle\caches\modules-2\files-2.1\org.opentest4j\opentest4j\1.2.0\28c11eb91f9b6d8e200631d46e20a7f407f2a046\opentest4j-1.2.0.jar
testRuntimeClasspath 2: org.apache.groovy:groovy:4+
testRuntimeClasspath 2: org.spockframework:spock-core:2.3-groovy-4.0