scalabuildsbtwarxsbt-web-plugin

Multi-project build with xsbt-web-plugin not packaging WAR file


I have multiple projects, one of which needs to be packaged as a WAR file. However, it gets packaged as a JAR File. Here's my build file:

enablePlugins(WarPlugin)

val foo = project in file("foo")

val war = project in file("war")

val root = project in file(".") aggregate(foo, war)

Solution

  • I noticed that what does get built is the root project, so I moved the enablePlugins call to the specific project:

    val foo = project in file("foo")
    
    val war = (project in file("war"))
                  .enablePlugins(WarPlugin)
    
    val root = project in file(".") aggregate(foo, war)