Search code examples
playframeworkplayframework-2.0dependencies

Play! framework add external jar dependecies using SBT


I am using play 2.1.4 and i want to add my external jar library in my project but that jar is further dependent on some maven dependencies, i have my external jar in /lib folder. I want to include this jar from local repository (/lib) along with maven dependencies from maven repository through SBT


Solution

  • You are trying to mix managed and unmanaged dependencies in SBT. http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies

    You can:

    1. Put your jar with all its dependent jars into the lib folder. A bit of manual work.
    2. Put only your jar into the lib folder and add all Maven dependencies to SBT (build.sbt). In this case your jar will be an unmanaged resource, but the dependencies will be managed by SBT.
    3. Build your jar so that it already contains all dependencies: How can I create an executable JAR with dependencies using Maven?