Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding MySql to playframework 2.2.1

I am trying to connect to a mysql database using the play framework. From my own searching, I know I need to add this line somewhere:

"mysql" % "mysql-connector-java" % "5.1.18"

However, in every documentation/similar question it says that this line either goes into the Build.scala file or the build.sbt file and I have neither of those files. When I created my application (as a java app) it only gave me a build.properties and plugins.sbt which are inside the project folder.

Does anyone know how where to add this line? Do I need to create one of those files?

My build.properties file:

 sbt.version=0.13.0

And

plugins.sbt

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

UPDATE: After adding

addSbtPlugin("mysql" % "mysql-connector-java" % "5.1.18") to my plugins file:

enter image description here

like image 721
jlars62 Avatar asked Jan 26 '14 18:01

jlars62


1 Answers

Add this line in plugin.sbt

addSbtPlugin("mysql" % "mysql-connector-java" % "5.1.18")
like image 77
Ashish Ratan Avatar answered Nov 08 '22 20:11

Ashish Ratan