11
votes

I have the following project structure:

lazy val root = project.aggregate(rest,backend)
lazy val rest = project
lazy val backend = project

When I execute the "run" task from the parent, I want a specific class from the "backend" project to have its main method executed. How would I accomplish this?

1

1 Answers

6
votes
lazy val root = project.aggregate(rest,backend).dependsOn(rest,backend) //<- don't forget dependsOn
lazy val rest = project
lazy val backend = project.settings(mainClass in (Compile, run) := Some("fully.qualified.path.to.MainClass"))

run in Compile <<= (run in Compile in backend)