Lets say I have this dependency defined in my build.gradle:
dependencies {
classpath "org.codehaus.groovy:groovy-all:2.4.0"
classpath "com.opencsv:opencsv:3.1"
}
Is there a way for me to get the absolute file path location of the 2 .jar files resulting from the above dependency, as a List object?
The following piece of code will do the job:
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
lol
}
dependencies {
lol "org.codehaus.groovy:groovy-all:2.4.0"
lol "com.opencsv:opencsv:3.1"
}
task printLocations << {
configurations.lol.files.each { println it }
}
Don't know what's your goal but in general that's the way to go.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments