diff --git a/README.md b/README.md index c7b2538..2dd3db8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,31 @@ Once you are inside the project directory, run the application: $ sbt run ``` +## Running the Application with sbt-revolver + +To manage the quickstarts application lifecycle more effectively and avoid issues like the `Port already bound` error when restarting the server, we have integrated the `sbt-revolver plugin`. This plugin allows you to start, stop and monitor easily using the following commands: + +1. To start the application in a forked JVM, use the `reStart` command: + +```bash +$ sbt reStart +``` +This will start quickstart application, and if it's already running, it will first stop the previous instance before restarting. + +2. To stop the running application, use the `reStop` command: + +```bash +$ sbt reStop +``` +This command will force-kill the forked JVM running your application. Note that any shutdown hooks (e.g., graceful shutdown logic) will not be executed when using this command. + +3. To check the current running state of application, use the `reStatus` command: + +```bash +$ sbt reStatus +``` +This will provide you with a log message about whether the application is currently running or stopped. + ## List of Quickstarts - [ZIO Cache](zio-quickstart-cache) diff --git a/project/plugins.sbt b/project/plugins.sbt index e7aff9f..93a7d80 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,6 @@ addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") + resolvers ++= Resolver.sonatypeOssRepos("public")