- For every SBT project, we have an assembly.sbt file in the project's project folder. If the file is not present, then we create one.
- Add the SBT assembly plugin dependency in the file:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
- Now go to the project root directory and run the sbt update command from the command line and it will download the plugin dependency jar.
- Now go to the project root directory and run the sbt assembly command to package the jar. It will package the code along with the project dependencies.
- Now we can run any recipe, as follows:
java -cp assemblyPath fullyQualifiedClassName java -cp /user-directory/Hello-Akka/target/scala-2.11/Hello-Akka- assembly-1.0.jar com.packt.chapter5.ScheduleActor ...