Gradle Play plugin does not include test resources in classpath when running tests


(Chun Yang) #1

The testPlayBinary task does not include resources from the test/resources directory, which is the default test resources directory when building play applications using SBT.

I’ve modified PlayTestPlugin to add a task that copies the resources into the test classpath. The pull request is #527 (sorry, unable to post a link)

I think ultimately the resource path should be exposed and configurable via the DSL, but this should be a good workaround for the present.

(Carsten Mjartan) #2

Any news on this? Is there a workaround?

(Carsten Mjartan) #3

Ok, found the workaround for myself:

model {
    tasks.testPlayBinary {
        classpath.add project.files("$projectDir/test/resources")