Build using sbt
Create a fat JAR
Environment:
- Scala: 2.13.1
- sbt: 1.3.8
Create a fat JAR in a Scala sbt project:
Create a new file
assembly.sbt
in project (sources root) folderAdd a
sbt-assembly
plugin by adding the following line to theassembly.sbt
file:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
- Specify the assembled JAR name in the
build.sbt
file:
assemblyJarName in assembly := "yourJar.jar"
- Start sbt shell and execute
assembly
command
Fat JAR is created in the target/scala-2.13
folder
Resolve postfix operator needs to be enabled error
Environment:
- Scala: 2.13.1
- sbt: 1.3.8
An error: postfix operator needs to be enabled by making the implicit value scala.language.postfixOps visible
can be resolved by adding the following line to the build.sbt
file:
scalacOptions ++= Seq(
"-language:postfixOps"
)