0

Using SBT with xsbt-web-plugin, when I go to the console (sbt console), I can't access anything in src/main/webapp that is normally on the containers classpath.

Context is: I'm trying to take certain code that runs in both the webapp and unit tests, and run it in the console. Everything is fine until I reach code that loads one of the view templates stored in src/main/webapp, which it expects to find on the classpath.

Golly
  • 1,319
  • 8
  • 18

1 Answers1

0

The contents of webapp are generally not included on the classpath in deployment (i.e. under standard J2EE containers such as Tomcat, Jetty, etc.), so you might want to move your resources somewhere more conventional, such as src/main/resources which is included on both the runtime and the container classpath.

Here is an example xsbt-web-plugin project that uses Mustache templates that are stored under src/main/resources and thus included on the classpath.

earldouglas
  • 13,265
  • 5
  • 41
  • 50