Simple build tool (SBT) package WAR

谁说我不能喝 提交于 2019-12-07 23:10:25

问题


I have a multiple project configuration. One of the projects needs to be build as a war file for future deployment. I used this sbt-plugin: https://github.com/JamesEarlDouglas/xsbt-web-plugin to build the war. However I need it to include depended projects as jars.

In maven I included other modules as a dependency in my WAR module and they appeared eventually in the WAR:lib directory. It seems that sbt-web-plugin default behavior is not to include them

What I mean is: This is a part of my parent.scala file

lazy val dataPopulator = Project(
"data-populator",
    file("data-populator"),
    settings = buildSettings ++ Seq (libraryDependencies ++= dataPopulatorDeps)) 

lazy val warProject = Project(id = "rest-ws",
    base = file("rest-ws"),
    settings = buildSettings ++ Seq (libraryDependencies)) dependsOn(dataPopulator)

The dataPopulator Project above when packaged creates a jar. The warProject Project above have a specific build.sbt in it's directory rest-ws/build.sbt:

seq(webSettings :_*)

name := "main-ws"

libraryDependencies += "org.mortbay.jetty" % "jetty" % "6.1.22" % "container"

When I run the package command (added by the web plugin) it creates a war, the problem is that this war doesn't include dataPopulator jar while it depends on it during compile time.

Anyone have a suggestion how to include generated jar artifacts from some modules into another project that is packaged as war ?

来源:https://stackoverflow.com/questions/15461147/simple-build-tool-sbt-package-war

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!