Get a path to dependencie's jar file

Is it possible to get a path to jarFile which presents a jar file writen in dependencies block?

Sample instance:

apply plugin: 'java'
  repositories.mavenCentral()
dependencies {
    testCompile 'org.testng:testng:6.8.1'
}
  task myTask(){
   // ...
   getDependenciesPath()
   /// ...
}
  String getDependenciesPath(){
   // code that gets the path to already compiled TESTNG library...
}

Basicaly that is because I need to execute a task, which should contain a path to library, which it depends On

found solution:

configurations.compile.each {
        println it
}

this will show all the jars pathes for this configuration

ResolvedArtifact artifact = configurations.testCompile.resolvedConfiguration.resolvedArtifacts.find { it.moduleVersion.id.name == “testng” } def id = artifact.moduleVersion.id println “$artifact.file, $id.group, $id.name, $id.version”