- Download and install SBT - http://www.scala-sbt.org/download.html
- Create SBT Scala Project by running this command - sbt new sbt/scala-seed.g8
- When prompted for the project name, type HelloWorld. This will create a new project under a directory named HelloWorld.
- Run
the sample application by access HelloWorld folder, type sbt, compile and run.
- Add sbt-assembly as a dependency in project/assembly.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") - Type assembly.
- Now you'll have an awesome new assembly task which will compile your project, run your tests, and then pack your class files and all your dependencies into a single JAR file: target/scala_X.X.X/projectname-assembly-X.X.X.jar.
- Type java -jar target/scala_X.X.X/projectname-assembly-X.X.X.jar to run the program.
Tuesday, July 4, 2017
Create Scala Project using SBT and Jar using sbt-assembly
Labels:
Scala
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment