28

I need some resources (text files) for my tests in a Scala Play 2.0 application. Where can I put these files?

In a maven app I would put them into src/test/resources, but I cannot find anything about an equal directory in the Play documentation.

I can put them in the confdirectory, but I only need them when I test the application.

Schleichardt
  • 7,502
  • 1
  • 27
  • 37
Sonson123
  • 10,879
  • 12
  • 54
  • 72

3 Answers3

49

Call

play "show test:resource-directory"

in the console and it shows you the absolute path to your resource directory in test mode. It will be in "test/resources".

"show" is a sbt command (or task) that enables you to retrieve the values of settings.

Schleichardt
  • 7,502
  • 1
  • 27
  • 37
3

Elevating SathOkh's comment for more visibility.

With sbt 1.3.13:

$ sbt "show test:resourceDirectory"
...
[info] /path/to/project/test/resources
user1338062
  • 11,939
  • 3
  • 73
  • 67
0

or nowadays, less deprecated:

$ sbt "show Test/resourceDirectory"
...
[info] /path/to/project/test/resources