Skip to content

Latest commit

 

History

History

a-config-akka-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

simple akka config example Build Status

A simple akka getting started example quickly created in idea IDE (sbt wrapper, scala 2.13, akka 2.6.x + testkit, scalatest, scalactic)

getting started

minimal build.sbt file:

name := "a-config-akka-example"

version := "0.1"

scalaVersion := "2.13.0"

val akkaVersion = "2.6.0-M3"
val scalatestVersion = "3.0.8"
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

implement fatJar

create project/assembly.sbt file:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")

update build.sbt file:

lazy val commonSettings = Seq(
  organization := "com.github.daggerok",
  scalaVersion := "2.12.6",
  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-config-akka-example/target/scala-2.13/a-config-akka-example-assembly-0.1.jar ...
# ...
java -jar ./target/scala-*/*-assembly-*.jar

resources: