title: How to create fat jar using sbt
body: <p>I am newbie to spark programming. I want to create fat jar which include all dependency jars as well. Currently I am running spark application with following command</p>
  
  <pre><code>./spark-submit -class XYZ --jars dependency_1,dependency_2 main.jar
  </code></pre>
  
  <p>But I don't want each and every time to pass these dependency jar. I googled it but could not find working solution. </p>
  
  <p>One of way I tried is using assembly plugin. But it's giving following error.</p>
  
  <pre><code>[error] Not a valid command: assembly
  [error] Not a valid project ID: assembly
  [error] Expected ':' (if selecting a configuration)
  [error] Not a valid key: assembly
  [error] assembly
  [error]  
  </code></pre>
  
  <p>So please any one have idea which is best way to create fat jar.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit1</strong>--</p>
  
  <p>My <strong>build.sbt</strong>--</p>
  
  <pre><code>import AssemblyKeys._
  
  assemblySettings
  
  name := "Update Sim Count"
  
  version := "1.0"
  
  scalaVersion := "2.10.0"
  
  libraryDependencies += "org.apache.spark" %% "spark-core" % "1.6.0"
  libraryDependencies += "org.apache.spark" %% "spark-sql" % "1.6.0"
  libraryDependencies += "com.datastax.spark" %% "spark-cassandra-connector" % "1.5.0-RC1"
  
  libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.12"
  </code></pre>
  
  <p><strong>assembly.sbt:</strong></p>
  
  <pre><code>addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
  </code></pre>
  
  <p><strong>Edit2-</strong></p>
  
  <p>Answer given by @Chobeat worked. Followed that blog. No need of build.scala from that blog. You can only add assembly.sbt and few lines to build.sbt. That will work for you. Thanks @Chobeat for your help.</p>