Reputation: 257
I am implementing custom deploy Task in SBT and I need to copy all required jars to deployment folder.
I am able to get paths to all external dependencies using update
TaskKey. Unfortunately updateReport does not include internal dependencies.
Here is my simple configuration
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
}
So, the question is how can I obtain absolute path to internal project dependencies i.e. project-a.jar, project-b.jar
Upvotes: 3
Views: 1887
Reputation: 22742
If you set the exportJars
property:
exportJars := true
then
exportedProducts in Compile
Should give you the path to the jar file for a project:
> show export-jars
[info] true
> show exported-products
[info] List(Attributed(/Users/luke/Work/myproject/server/target/scala-2.9.2/server_2.9.2-0.3-SNAPSHOT.jar))
[success] Total time: 0 s, completed Oct 5, 2012 11:29:51 PM
Upvotes: 4