I'm using sbt 11.2 and xsbt web plugin for a web project (which is multi module). I'm trying to change the war file name generated by sbt. It has version which I like to not to include.
I tried overriding several keys without luck
lazy val admin = Project("admin", file("admin"),
settings = baseSettings ++ webSettings ++ jettySettings ++ Seq(
name := "admin",
moduleName := "my-admin",
...
Appreciate if someone can show me how to change war file name
Thanks
This ought to to the trick:
++ inConfig(Compile)(
artifact in packageWar <<= moduleName(n => Artifact("my-" + n, "war", "war"))
)
See:
https://github.com/siasia/xsbt-web-plugin/blob/master/src/main/scala/com/github/siasia/WarPlugin.scala#L60
In build.sbt, overriding the key artifactName works for me:
artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + module.revision + "this-goes-in-war-filename." + artifact.extension
}
Taken from the sbt documentation here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With