I have the following root project setup:
lazy val root = project.aggregate(rest,backend).dependsOn(rest,backend)
lazy val rest = project
lazy val backend = project.dependsOn(rest).settings(mainClass in (Compile, run) := Some("my.backend.services.Main"))
run in Compile <<= (run in Compile in backend)
When I type run
I get an error stating that:
[error] (run-main) java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/db?user=userid&password=password java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/....
So it seems the "mysql" % "mysql-connector-java" % "5.1.26"
dependency in the backend
project isn't part of the classpath during the run? I find it odd it's just this dependency and not others... Is it the way in which the class is being loaded dynamically?
Is there a work around for this?