sbt-revolver icon indicating copy to clipboard operation
sbt-revolver copied to clipboard

No main class detected for submodules without main class

Open hellhoundmipt opened this issue 2 years ago • 1 comments

I have a project with a root module (obviously has a main class, object Main for example) that depends on multiple other modules that do not have main classes as they are used as libs. In build.sbt I specify mainClass in reStart := Some("Main"). When I start an app with sbt ~reStart, it works fine and restarts when source code in any of the modules changes, but it throws java.lang.RuntimeException: No main class detected for all the subprojects. Not something severe as it does everything it is supposed to do, but errors in logs are annoying. Any fix for this?

hellhoundmipt avatar Jun 23 '22 15:06 hellhoundmipt

Does disabling Revolver explicitly on each project that does not require it help? (https://github.com/spray/sbt-revolver/issues/66)

jonathonherbert avatar Sep 26 '22 17:09 jonathonherbert

I'd suggest to move to the submodule first that has the main class, e.g.

sbt "project <module>" ~reStart

or using

sbt "~<module>/reStart"

jrudolph avatar Mar 08 '23 08:03 jrudolph