如何在运行时指定SBT主类

时间:2015-07-16 11:07:08

标签: sbt

我希望能够指定从命令行运行SBT项目时要使用的主类,而不必像在此示例中那样从列表中选择它:

[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

[1] sample.stream.BasicTransformation
[2] sample.stream.GroupLogFile
[3] sample.stream.TcpEcho
[4] sample.stream.WritePrimes

Enter number:

1 个答案:

答案 0 :(得分:2)

要运行特定的类,命令为:

sbt "runMain my.class.Name param1 param2"