0

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)
Omer van Kloeten
  • 11,800
  • 9
  • 42
  • 53

1 Answers1

0

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)
Omer van Kloeten
  • 11,800
  • 9
  • 42
  • 53
  • Does it package the WAR properly now? Are you sure you need `aggregate` instead of `dependsOn`? – Yuval Itzchakov May 24 '16 at 09:05
  • I'm having trouble reproducing this issue. Can you take a look at https://github.com/earldouglas/so-37407726 and let me know how your project differs? – earldouglas May 24 '16 at 14:58
  • @YuvalItzchakov yes, I want packaging the root to package foo and war both. – Omer van Kloeten May 26 '16 at 08:55
  • @James no difference. Note that you're running the code from my answer, rather than the one from the question. Change your build.sbt to the one in the question and the JAR that gets built into a WAR is the root, rather than the war project. I'm pretty certain this isn't a bug, just me configuring the build wrong. – Omer van Kloeten May 26 '16 at 08:56
  • 1
    Note: the above link has been updated to https://earldouglas.com/ext/stackoverflow.com/questions/37407726/ – earldouglas Feb 19 '17 at 01:57