How to get the file path location of a .jar dependency?

djangofan

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?

Opal

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to get path to dependency jar with maven

From Java

Get location of JAR file

From Java

How to get the path of a running JAR file?

From Java

How to get a path to a resource in a Java JAR file

From Dev

How to get a running Jar's file path?

From Dev

How can I get Jetty to scan the Maven dependency jar files in the class path?

From Java

How to get .jar resources path?

From Java

How to download maven dependency as *.jar file?

From Java

How to add a dependency into a jar file in java

From Dev

How to modify a file contained in a JAR that is a dependency in IntelliJ

From Dev

How to get a compile error if a JAR dependency is missing?

From Java

Get absolute path of resource file inside a jar

From Dev

Get relative path from jar file

From Dev

maven: how to build the dependency from source.jar to jar files and put the jar file as it dependency?

From Dev

How to get file path?

From Dev

Java get path of executing jar without .jar file

From Java

How do I convert a "jar:file" URI to the path of Jar file?

From Dev

How to get the "path" in React... "location" not found

From Dev

How to get Previous path location in angularjs

From Java

How to add local .jar file dependency to build.gradle file?

From Dev

How can I find the location of a file in the system path, like get-command or where?

From Dev

When writing a bash script, how do I get the absolute path of the location of the current file?

From Java

How to construct a Path from a jar:file URL?

From Dev

How to write a path that points outside a JAR file

From Dev

How to get the file location of the current wallpaper file?

From Dev

How to execute jar file with a external dependency using command line on Windows?

From Dev

How can I determine if upgrading a dependency will break a jar file?

From Java

How to maintain project and dependency jar versions for Gradle build in property file?

From Dev

How to read war-file manifest in its jar-dependency?

Related Related

  1. 1

    How to get path to dependency jar with maven

  2. 2

    Get location of JAR file

  3. 3

    How to get the path of a running JAR file?

  4. 4

    How to get a path to a resource in a Java JAR file

  5. 5

    How to get a running Jar's file path?

  6. 6

    How can I get Jetty to scan the Maven dependency jar files in the class path?

  7. 7

    How to get .jar resources path?

  8. 8

    How to download maven dependency as *.jar file?

  9. 9

    How to add a dependency into a jar file in java

  10. 10

    How to modify a file contained in a JAR that is a dependency in IntelliJ

  11. 11

    How to get a compile error if a JAR dependency is missing?

  12. 12

    Get absolute path of resource file inside a jar

  13. 13

    Get relative path from jar file

  14. 14

    maven: how to build the dependency from source.jar to jar files and put the jar file as it dependency?

  15. 15

    How to get file path?

  16. 16

    Java get path of executing jar without .jar file

  17. 17

    How do I convert a "jar:file" URI to the path of Jar file?

  18. 18

    How to get the "path" in React... "location" not found

  19. 19

    How to get Previous path location in angularjs

  20. 20

    How to add local .jar file dependency to build.gradle file?

  21. 21

    How can I find the location of a file in the system path, like get-command or where?

  22. 22

    When writing a bash script, how do I get the absolute path of the location of the current file?

  23. 23

    How to construct a Path from a jar:file URL?

  24. 24

    How to write a path that points outside a JAR file

  25. 25

    How to get the file location of the current wallpaper file?

  26. 26

    How to execute jar file with a external dependency using command line on Windows?

  27. 27

    How can I determine if upgrading a dependency will break a jar file?

  28. 28

    How to maintain project and dependency jar versions for Gradle build in property file?

  29. 29

    How to read war-file manifest in its jar-dependency?

HotTag

Archive