title: How to execute Main-Class as part of compile in SBT
body: <p>I wanted to execute a task as part of SBT compile, I tried <code>runMain in compile</code> but it is not executing the main class that I am providing. Below is how task looks like in <code>build.sbt</code></p>
  
  <pre><code>lazy val scalaGeneratorPlugin =  Project("scala-generator", file("scala-generator"))
    .settings(
      libraryDependencies += "org.freemarker" % "freemarker" % "2.3.23",
          runMain in compile := Some("com.my.MyMainClass")
    )
  </code></pre>
  
  <p>I am running following command:</p>
  
  <pre><code>sbt scala-generator/compile
  </code></pre>
  
  <p>Although it gives me <code>success</code> message, it does not execute my MainClass </p>