Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对我来说,创建一个依赖于外部 jar 并且旨在使用外部 jar 中的 Main 方法运行的 sbt 项目是很常见的。目前,我只是使用“run-main xxx”运行它,但我更希望能够将 Main 方法包含在 sbt 提供的 run() 选项列表中。是否有捷径可寻?或者是包含一个作为 run-main xxx 别名的 sbt 任务的最佳选择?
收集了主要类的列表,discoveredMainClasses您可以对其进行转换以显式添加您自己的类:
discoveredMainClasses
discoveredMainClasses in Compile += "org.example.Main"