SBT, run main class from dependency project

My build.sbt:

libraryDependencies += "org" %% "A" % "0.0.1"

      

So, I run sbt on this file:

> sbt

      

I know that "A" has a main class, say "mainRun.scala". But I cannot run it from my project.

How do I start it from SBT?

+3


source to share


1 answer


By default, sbt does not consider your dependencies to automatically detect the main class. However, you can force it to use a specific class, either on the command line with

> runMain pack.MainClass

      



or via sbt setting

mainClass := Some("pack.MainClass")

      

+1


source







All Articles