Situation: I want to run JUnit test cases for my game! 2.0 on the Jenkins server. To create and test my application on the server, I want to use SBT (with a sequence of commands: clean compile test ).
Problem: Regardless of Jenkins, the play test command uses a different class path than the java -jar "sbt-launch.jar" test command (both commands are executed in the root directory of my playback project, both commands use the same version of sbt 0.12. 2). My test cases can be compiled using play test , but with java -jar "sbt-launch.jar" test compiler complains that some JUnit classes are missing (for example, org.junit.rules.TestWatcher ).
Analysis: The show test:full-classpath command shows that classpathes are really different:
play test classpath contains: Attributed(<playhome>\repository\local\junit\junit-dep\4.10\jars\junit-dep.jar)
java -jar "sbt-launch.jar test classpath contains: Attributed(<userhome>\.ivy2\cache\junit\junit-dep\jars\junit-dep-4.8.2.jar)
Question: Any ideas on how to ensure that java -jar "sbt-launch.jar test uses the same class path as play test ?
Build.scala:
import sbt._ import Keys._ import play.Project._ object ApplicationBuild extends Build { val appName = "my app" val appVersion = "1.0-SNAPSHOT" val appDependencies = Seq( // Play framework dependencies javaCore, javaJdbc, javaEbean, // Add your project dependencies here "com.typesafe" %% "play-plugins-mailer" % "2.1.0", "com.feth" %% "play-authenticate" % "0.2.5-SNAPSHOT", "org.mongodb" % "mongo-java-driver" % "2.10.1", "com.embedly" % "embedly-api" % "0.1.5", "org.mockito" % "mockito-all" % "1.9.5", "org.mongojack" % "mongojack" % "2.0.0-RC5", "commons-io" % "commons-io" % "2.3" ) val main = play.Project(appName, appVersion, appDependencies).settings( resolvers += Resolver.url("play-easymail (release)", url("http://joscha.github.com/play-easymail/repo/releases/"))(Resolver.ivyStylePatterns), resolvers += Resolver.url("play-easymail (snapshot)", url("http://joscha.github.com/play-easymail/repo/snapshots/"))(Resolver.ivyStylePatterns), resolvers += Resolver.url("play-authenticate (release)", url("http://joscha.github.com/play-authenticate/repo/releases/"))(Resolver.ivyStylePatterns), resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.com/play-authenticate/repo/snapshots/"))(Resolver.ivyStylePatterns) ) }