如何进行多项目构建,为每个子项目输出一个jar?

时间:2018-11-02 12:04:08

标签: scala sbt sbt-assembly

我有一个名为protected void Page_Load(object sender, EventArgs e) { DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Patient", typeof(string)); table.Columns.Add("Date", typeof(DateTime)); // Here we add five DataRows. table.Rows.Add(25, "Indocin", "David", DateTime.Now); table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now); table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now); table.Rows.Add(21, "Combivent", "Janet", DateTime.Now); table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now); rptDrugs.DataSource = table; rptDrugs.DataBind(); } 的项目和2个子项目:MainOne。这是我的Two的样子:

build.sbt

当我运行name := "Main" version := "0.1" scalaVersion := "2.12.7" lazy val root = Project(id = "root", base = file(".")) aggregate(one, two) dependsOn(one, two) lazy val one = Project(id = "one", base = file("One")) lazy val two = Project(id = "two", base = file("Two")) 时,我只为sbt compile package.jar)获得一个Main,但是我想为每个子项目获得一个Main.jar,而不是.jarMainOne.jar

我该如何实现?

我也不知道Two.jar是什么意思,我甚至需要吗?

我还希望每个子项目都使用aggregate(one, two) dependsOn(one, two)内置到一个胖子罐中。

1 个答案:

答案 0 :(得分:0)

它现在可以正常工作了。我遇到这种行为,因为sbt告诉我我的程序集未打包,因为它是最新的,但是后来我开始执行sbt clean assembly而不是sbt assembly,它的工作方式像现在很迷人。

相关问题