pbassiner/sbt-multi-project-example

running a jar gives Could not find or load main class

Closed this issue · 1 comments

I am trying to run Main in project1, but I get Could not find error

$ java -cp target/scala-2.12/sbt-multi-project-example-assembly-0.1-SNAPSHOT.jar monocle.macros.GenLens.Main
Error: Could not find or load main class monocle.macros.GenLens.Main

Hi @prayagupd,
actually tha assembly jar for the root project shouldn't be created, since it doesn't contain any source code but it's used to globally manage the other subprojects. I've updated issue #1 accordingly.

Each project has its own assembly jar in its own target folder (i.e. multi1/target/scala-2.12/multi1.jar) and executing it prompts the proper output:

$ java -cp multi1.jar Main
multi1 can use common sub-project
multi1 can use monocle dependency