我正在 SBT 中实现自定义部署任务,我需要将所有必需的 jar 复制到部署文件夹。我能够使用update
TaskKey 获取所有外部依赖项的路径。不幸的是 updateReport 不包括内部依赖。这是我的简单配置
val deploy = TaskKey[Unit]("deploy","deploy")
lazy val projectA = Project(id=project-a,
settings=Project.defaultSettings)
lazy val projectB = Project(id=project-b,
settings=Project.defaultSettings) dependsOn(projectA)
lazy val projectC = Project(id=project-c,
settings=Project.defaultSettings, ++ Seq(deployTask)) dependsOn(projectB)
val deployTask = deploy <<= (update) map {(updateReport) =>
val externalDependency = updateReport.allFiles //paths to all external dependencies are available here
//project-a.jar and project-b.jar are not here
}
所以,问题是如何获得内部项目依赖项的绝对路径,即 project-a.jar、project-b.jar