如何将artifactDependencies中的工件与dependencyClasspath中已解析的类路径相关联?
UPD
澄清问题:如何在文件系统上获取已解析的ModuleID的完整类路径?
示例:
我有ModuleID:"org.eclipse.jetty" % "jetty-servlets" % V.jetty
我想知道类路径是:C:\Users\user\.ivy2\cache\org.eclipse.jetty\jetty-servlets\jars\jetty-servlets-8.1.8.v20121106.jar
答案 0 :(得分:2)
您可以向build.sbt
添加任务,然后使用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}"))
}