A simple akka getting started example quickly created in idea IDE (sbt wrapper, scala 2.13, akka 2.6.x + testkit, scalatest, scalactic)
minimal build.sbt file:
name := "a-simple-example"
version := "0.1"
scalaVersion := "2.13.0"
val akkaVersion = "2.6.0-M8"
val scalatestVersion = "3.2.0-M1"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalactic" %% "scalactic" % scalatestVersion % Test
)
minimal Main.scala file:
object Main extends App {
println("hey!")
}
test and run app:
./sctw test
./sctw clean run
create project/assembly.sbt file:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
update build.sbt file:
lazy val commonSettings = Seq(
organization := "com.github.daggerok",
scalaVersion := "2.13.0",
test in assembly := {}
)
lazy val root = (project in file(".")).
settings(commonSettings: _*).
settings(
mainClass in assembly := Some("com.github.daggerok.akka.Main"),
// more settings here ...
)
build fat jar:
./sbtw clean assembly
# ...
[info] Packaging /path/to/a-simple-example/target/scala-2.13/a-simple-example-assembly-0.1.jar ...
# ...
java -jar ./target/scala-*/*-assembly-*.jar
resources: