I'm trying to add jar files to an sbt project, but I can't figure out where to store them. The sbt docs say "Just drop them in the lib folder, and you're good!", but don't give any information about where to actually put this lib folder. Does the lib folder go under src? at the top level hierarchy where the src folder is located? I'm really not sure, and would appreciate some help.
All new SBT versions (after 0.7. x ) by default put the downloaded JARS into the . ivy2 directory in your home directory. If you are using Linux, this is usually /home/<username>/.
Solution. You can use both managed and unmanaged dependencies in your SBT projects. If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.
According to http://alvinalexander.com/scala/how-to-create-sbt-project-directory-structure-scala , lib should be a subdirectory of your project directory. I just tried it, it works.
.
|-- build.sbt
|-- lib
|-- project
|-- src
| |-- main
| | |-- java
| | |-- resources
| | |-- scala
| |-- test
| |-- java
| |-- resources
| |-- scala
|-- target
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With