Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT: specify which app to test:run

Tags:

scala

sbt

Is there a way to specify which app to run instead of having it ask me?

> test:run

Multiple main classes detected

[1] junk.Hi
[2] junk.Ho
[3] junk.Hey

Enter number:

I tried doing this, but it didn't help:

> set mainClass in (Compile, test) := Some("junk.Ho")

And this doesn't work (presumably) because the app to run is in the test sources:

> runMain junk.Ho
[info] Running junk.Ho
[error] (run-main) java.lang.ClassNotFoundException: junk.Ho
like image 277
dvmlls Avatar asked Sep 12 '25 18:09

dvmlls


1 Answers

This should work:

>test:runMain junk.Ho
like image 125
Christian Avatar answered Sep 15 '25 06:09

Christian