Alex
Alex

Reputation: 1668

Continuous build and run with SBT

I'm tyring to find a better method to run my SBT project with continuous build (compile) and run, SBT can already do continuous compile and test but not with the run command unless I'm not aware how that is possible.

I tried using the ~ command on run but it does nothing sbt clean compile ~run

I tried using the spray sbt plugin addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") but it is so tempremental and hangs a lot while trying to kill the current process making it faster to just kill the app then run sbt clean compile run

Is there a way to achieve this?

Upvotes: 1

Views: 1586

Answers (1)

laughedelic
laughedelic

Reputation: 6460

sbt clean ~run should work fine and rerun main method every time you change the sources. But if you're running a web server which is supposed to run continuously, sbt won't interrupt it to rerun.

So you should use sbt-revolver for that and solve any problems with it by either asking another question or submitting a bug report for the plugin.

Upvotes: 3

Related Questions