Omid
Omid

Reputation: 1989

SBT, Run a 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 there is Main class in 'A', let's say "mainRun.scala". But I don't how to run it from my project.

How should I run it from SBT?

Upvotes: 3

Views: 714

Answers (1)

sjrd
sjrd

Reputation: 22105

By default, sbt does not look into your dependencies for the auto detection of a main class. You can can however force it to use a specific class, either on the command line with

> runMain pack.MainClass

or via the sbt setting

mainClass := Some("pack.MainClass")

Upvotes: 1

Related Questions