Note that there are some explanatory texts on larger screens.

plurals
  1. PO"play test" classpath differs from "sbt test" classpath
    primarykey
    data
    text
    <p>Situation: I want to execute JUnit test cases for my Play! 2.0 application on a Jenkins Server. To build and test my app on the server I want to use SBT (with command sequence: <code>clean compile test</code>). </p> <p>Problem: Regardless of Jenkins, the command <code>play test</code> uses a different classpath than the command <code>java -jar "sbt-launch.jar" test</code> (both commands executed in the root directory of my play project, both commands use the same sbt version 0.12.2). My test cases can be compiled with <code>play test</code> but with <code>java -jar "sbt-launch.jar" test</code> the compiler complains that some JUnit classes (e.g., <code>org.junit.rules.TestWatcher</code>) are missing. </p> <p>Analysis: The command <code>show test:full-classpath</code> reveals that the classpathes indeed differ: </p> <p><code>play test</code> classpath contains: <code>Attributed(&lt;playhome&gt;\repository\local\junit\junit-dep\4.10\jars\junit-dep.jar)</code></p> <p><code>java -jar "sbt-launch.jar test</code> classpath contains: <code>Attributed(&lt;userhome&gt;\.ivy2\cache\junit\junit-dep\jars\junit-dep-4.8.2.jar)</code></p> <p>Question: Any ideas how to ensure that <code>java -jar "sbt-launch.jar test</code> uses the same classpath as <code>play test</code>?</p> <p>Build.scala: </p> <pre><code>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) ) } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload