sbt:在子项目上运行任务 [英] sbt: run task on subproject
本文介绍了sbt:在子项目上运行任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下项目结构:
lazy val root = project.aggregate(rest,backend)
lazy val rest = project
lazy val backend = project
当我从父级执行运行"任务时,我希望后端"项目中的特定类执行其 main
方法.我将如何做到这一点?
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?
推荐答案
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)
这篇关于sbt:在子项目上运行任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文