I create a Scala Play 2.0 project then add a Test
object with a barebones main
function.
When I run the Test
object I get a ClassDefNotFoundError
. This is because the Test
object is apparently not being compiled into a file in any project folder.
Running the bundled Play server works fine.
Has anyone tried adding a runnable object to a Scala Play framework project and had success?
The Test
object is being created in a new module, within the Play project named test-module
.
**** Update ****
It seems like SBT is somehow conflicting with the 'test-module' module. Play is an SBT project so it compiles to its 'target' directory. However 'test-module' is not SBT and therefore wants to compile to the 'out' directory. Problem is the compiled files never make it to the 'out' directory, in fact they don't make it to any directory at all.