Add an extra lib folder dependency to build sbt in a lift project
Asked Answered
A

1

6

I have an external java project that my lift project depends on. I have been able to add the dependency to the classes in that project by adding the following line to my sbt:

unmanagedClasspath in Compile += file("[Path to My Project]/classes")

But this project also has a lib folder with a set of jars that it references and I cannot figure out what the correct syntax should be to add these dependencies. Have tried the following but it does not work:

unmanagedJars in Compile += file("[Path to My Project]/lib/*.jar")

Any pointers greatly appreciated

Regards

Des

Attenuant answered 5/6, 2013 at 12:36 Comment(0)
N
7

You can use sbt's Path API to get all jars in your directory.

Edit: a shorter version using .classpath:

unmanagedJars in Compile ++= 
  (file("[Path to My Project]/lib/") * "*.jar").classpath

which is more or less equivalent to:

unmanagedJars in Compile ++= 
  Attributed.blankSeq((file("[Path to My Project]/lib/") * "*.jar").get)

(Attributed is necessary because unmanagedJars is a setting of type Seq[Attributed[File]] and not Seq[File])

Newbill answered 5/6, 2013 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.