Add an additional lib folder dependency to build sbt in the elevator project

I have an external java project that my elevator project depends on. I was able to add the dependency to the classes in this 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 refers to, and I cannot figure out what the correct syntax should be for adding these dependencies. Tried the following, but it does not work:

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

Any pointers really appreciated

Hello

Des

+6
source share
1 answer

You can use the sbt Path API to get all the banks in your directory.

Edit : shorter version using .classpath :

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

which is more or less equivalent:

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

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

+6
source

Source: https://habr.com/ru/post/946589/


All Articles