Neilos
Neilos

Reputation: 2746

Why are new dependencies not picked up by Play 2.3.4 project in Eclipse?

I updated my project to include some dependencies with the following lines in build.sbt:

libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.33"
libraryDependencies += "org.springframework" % "spring-jdbc" % "4.1.1.RELEASE"

classes_managed was added to the classpath, but the directory does not exist and the libs are not present.

I cleaned the project, removed all errors (including all references to the classes in the managed libs), compile, but still the directory and libs are missing.

SBT does not seem to want to download the libs... not sure what I am doing wrong.

Upvotes: 0

Views: 2578

Answers (1)

Jacek Laskowski
Jacek Laskowski

Reputation: 74709

Any dependency managed by sbt ends up in ~/.ivy2/cache (it's configurable).

When you declare a project's dependency with libraryDependencies you should execute update (explicitly) or any other command to build up your project assembly like package or assembly that is going to pull them down (via update implicitly).

One caveat might be that you may've changed build.sbt without reloading a sbt session that makes the changes with no effect on the build. You should do reload to re-read the build definition or close sbt and start over.

A very helpful command to see what libraryDependencies are in use is show libraryDependencies. It's going to show you all the dependencies sbt knows about.

Once it's done, run eclipse command that prepares the files for the IDE. Do project reload in Eclipse and all should be fine.

It equally applies to sbt or Typesafe Activator (and partially IntelliJ IDEA).

Upvotes: 8

Related Questions