If I have a simple object with a main
method in the test
folder of a project, how do I run it with sbt?
sbt "test:runMain path.to.MainObjectInTest"
...And if you have multiple projects in you sbt file then:
sbt "projectName/test:runMain path.to.MainObjectInTest"
or just use:
sbt "projectName/test:run"
If you have only one object with main, this will run it. If you have multiple objects with main, it will ask you to select which one to run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With