I am using postgresql 9.2 with play framework 2.1
I downloaded the driver here: http://jdbc.postgresql.org/download.html (JDBC4 Postgresql Driver, Version 9.2-1002)
My project/Build.scala
file is as follows:
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "myApp"
val appVersion = "0.1"
val appDependencies = Seq(
"postgresql" % "postgresql" % "9.2-1002.jdbc4")
val main = play.Project(appName, appVersion, appDependencies)
}
I have placed the jdbc driver in the following locations in the play directory structure:
myApp/lib/postgresql-9.2-1002.jdbc4.jar
myApp/lib/9.2-1002.jdbc4.jar
myApp/lib/postgresql/postgresql/9.2-1002.jdbc4.jar
However, running the app with play run
, I get the following error and the build fails:
[warn] module not found: postgresql#postgresql;9.2-1002.jdbc4
[warn] ==== local: tried
[warn] /home/ubuntu/play-2.1.0/repository/local/postgresql/postgresql/9.2-1002.jdbc4/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: postgresql#postgresql;9.2-1002.jdbc4: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: postgresql#postgresql;9.2-1002.jdbc4: not found
Any tips on how to get the Play! to recognize my jar file?
I solved the problem using the information at the following link:
https://github.com/tminglei/slick-pg/issues/1
I hope you find it useful!! :)
good luck ;)
linixinil.
The 9.2 version of Postgresql driver has not yet hit the Maven central repo, so you'll have to use the 9.1 version :
Or you can use the 9.2 version by dropping the JAR in your
myApp/lib
folder and remove any dependency from yourproject/Build.scala
file (thelib
folder is automatically added by sbt).I have found this in the Repository:
In file application.conf:
create the pasta /lib in your main project and should add the .jar do postgres.
Download here, and after reload the project.
When I change 9.2 version to 9.1 version, it works perfectly. Thanks for your answer nico_ekito
My buid.scala
My application.conf