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

4

1 回答 1

7

您可以使用 sbt 的Path API来获取目录中的所有 jar。

编辑:使用较短的版本.classpath

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

这或多或少等同于:

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

Attributed是必要的,因为unmanagedJars是类型的设置Seq[Attributed[File]]而不是Seq[File]

于 2013-06-05T12:58:21.870 回答