Search code examples
javaeclipsesolrplayframeworksolrj

Play Framework 2.4.6 does not install dependencies


I am adding dependencies into build.sbt. I can see that it is downloaded, but it does not exist in library and I cannot import it either. It does not exist in either Referenced Libraries, or JRE System Library. I have tried many dependencies and got the same result.

build.sbt:

name := "Project"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "org.apache.solr" % "solr-solrj" % "5.5.0"
)


play.Project.playJavaSettings

I can see that jar file is downloaded.

[info] downloading http://repo1.maven.org/maven2/org/apache/solr/solr-solrj/5.5.0/solr-solrj-5.5.0.jar ...
[info]  [SUCCESSFUL ] org.apache.solr#solr-solrj;5.5.0!solr-solrj.jar (649ms)

I cannot import it enter image description here


Solution

  • The following sequence of steps works for me.

    1. Add your dependency in build.sbt:
      libraryDependencies += "com.somemodule" % "somemodule-client" % "latest.integration"

    2. Refresh your Play project via activator in the terminal:
      i. Cd to your project directory
      ii. activator "eclipse with-source=true"

    3. Refresh your Eclipse project:
      In Eclipse, right-click your project and click refresh

    4. Restart your Play application. In your terminal running Play:
      i. Ctrl+D
      ii. activator run

    It seems you have only done step 1. Try following through with the other steps as well.