Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT, Run a main class from dependency project

Tags:

scala

sbt

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?

like image 518
Omid Avatar asked Nov 23 '25 20:11

Omid


1 Answers

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")
like image 73
sjrd Avatar answered Nov 26 '25 08:11

sjrd