Hey I am trying to sbt compile a Scala project with 2 external .jar libraries as dependencies. I've added them in the /lib folder and I can see they are recognized by sbt when I run "show unmanagedClasspath" I see the 2 jars. However when I run "sbt assembly", sbt tries to resolve dependencies and fails when it can't download the libraries that are already there.
Asked
Active
Viewed 1,927 times
3
-
Can you provide a test-case? It seems to work as intended in my simple reproduction of the issue. – Dale Wijnand Mar 23 '15 at 13:40
-
I have a project that uses 2 libs that are packaged in jar files. When I do sbt assembly it starts resolving those 2 libraries and fails. I add the 2 jars to /lib and run it again. Same thing happens – Todor Markov Mar 24 '15 at 07:34
1 Answers
3
You don't need to add the jars that you've in the \lib directory again in libraryDependencies. libraryDependencies is part of your managedClasspath and everything in lib directory is part of your unmanagedClasspath, both together forms your dependencyClasspath.
You can see this by typing this on sbt prompt and checking the dependencies section:
inspect externalDependencyClasspath
In this case 'external' just means dependencies that are external to the project (ie not internal project dependencies)

Ajay Padala
- 2,371
- 16
- 13