How to “package” some modules to jars and others to wars in multi-module build with single task?

為{幸葍}努か 提交于 2019-12-05 19:22:41

Both package task and assembly task evaluate to File type, so as @James commented you should be able to rewire assembly task in webapp project to run package instead.

lazy val commonSettings = Seq(
  scalaVersion := "2.11.4"
)
lazy val webappAssembly = Seq(
  assembly := packageWar.value
)

lazy val root = (project in file(".")).
  aggregate(app, webapp).
  settings(commonSettings: _*)

lazy val app = (project in file("app")).
  settings(commonSettings: _*)

lazy val webapp = (project in file("webapp")).
  settings(commonSettings ++ jetty() ++ webappAssembly: _*).
  settings(
    libraryDependencies += "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided"
  )
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!