LizzyMM
LizzyMM

Reputation: 43

why sbt-assembly failed to auto detect main class?

I have a Boot object with below definition

object Boot extends App with xxxService {} 

And add below lines in plugins.sbt to enable sbt-assembly

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")

then run this command to build up the whole project:

sbt clean compile assembly

In the genearted jar META-INF/MAINFEST.MF file, it does not have Main-Class generated, if I specify main class in build.sbt like mainClass in assembly := Some("com.XXX.Boot"), it worked.

My sbt version is 1.3.2, jvm is zulu8, scala is 2.12.13

From enter link description here it says, sbt-assembly will autodetect main class, then how does my example failed?

Upvotes: 0

Views: 383

Answers (1)

LizzyMM
LizzyMM

Reputation: 43

I update sbt-assembly into below

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

it can auto detect the main class without specify in build.sbt...

I guess this is might be related with sbt and scala verion... my colleague can run the config in the question correctly...

Upvotes: 0

Related Questions