问题
How to corellate artifact from libraryDependencies to its resolved classpath in dependencyClasspath?
UPD
Clarify question: How to get full class path on file system for resolved ModuleID?
Example:
I have ModuleID: "org.eclipse.jetty" % "jetty-servlets" % V.jetty
And I want to knpw that classpath is: C:\Users\user\.ivy2\cache\org.eclipse.jetty\jetty-servlets\jars\jetty-servlets-8.1.8.v20121106.jar
回答1:
You can add a task to your build.sbt
and then call it with printDependencyClasspath
val printDependencyClasspath = taskKey[Unit]("Prints location of the dependencies")
printDependencyClasspath := {
val cp = (dependencyClasspath in Compile).value
cp.foreach(f => println(s"${f.metadata.get(moduleID.key)} => ${f.data}"))
}
来源:https://stackoverflow.com/questions/23375298/how-to-get-full-class-path-on-file-system-for-resolved-moduleid-in-sbt