Search code examples
scalatestingplayframeworkplayframework-2.3specs2

Play 2.3.x: Multiproject, disable BoneCP


I've got a Play project with some subprojects. One of the subproject needs JDBC, so BoneCP (it accessed MySQL DB).

On the other hand, the root project doesn't need JDBC at all.

My problem is: JDBC is declared in the build.sbt of the subproject. When I run all the tests, and in this case the root project tests, BoneCP is initialized, even if just needed in the subproject. It brings me some problems during testing:

Configuration error[Cannot connect to database [default]]  (Configuration.scala:94)

Can I specify to Play to only use JDBC with the subproject ? Or can I disable JDBC or BoneCP in the root project ?

Thanks for your answers.


Solution

  • Finally get it !

    val withoutPlugins = Seq(classOf[ReactiveMongoPlugin].getName) Worked like a charm for disabling ReactiveMongo Plugin.

    And for the main problem: additionalConfiguration = Map("dbplugin" -> "disabled", "evolutionplugin" -> "disabled")

    No JDBC at all during tests. Thank you a lot Barry !