Can't generate a self-executable fat JAR
larruda opened this issue · 1 comments
Hello. I'm trying to generate a self executable fat JAR in order to use DBeam with Apache Airflow (using DataflowOperator, which requires it in such format). I've added sbt assembly
plugin and tried to use many different merge strategies, but although the fat JAR is built, it doesn't contain a main class specified in the MANIFEST file.
I added the following to project/plugins.sbt
:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
And also this to build.sbt
:
mainClass in assembly := Some("com.spotify.dbeam.JdbcAvroJob"),
When running with java -jar
I get:
no main manifest attribute, in dbeam-core/target/scala-2.12/dbeam-core_2.12-0.4.1-SNAPSHOT.jar
The same with the "pack" JAR.
Disclaimer: I'm not a Scala/SBT expert :-)
I finally got it to work!
The main class needed to be specified in dbeamCore
scope.
.settings(mainClass in assembly := Some("com.spotify.dbeam.JdbcAvroJob"))