I have a multi-module build, and a few of the modules have reference.conf files. So when I run the package task on the webapp module to a build a war, I have one of two problems:
With the default setting classesAsJar in Compile := false, the war contains one of the reference.conf files, chosen apparently arbitrarily.
classesAsJar in Compile := false
With the setting classesAsJar in Compile := true, the package task fails.
classesAsJar in Compile := true
java.util.zip.ZipException: duplicate entry: reference.conf
I see two ways xsbt-web-plugin could help me:
1) Package each module as a separate jar, so each jar can contain its own reference.conf without conflicts.
2) Follow the example of the sbt-assembly plugin and use a customizable merge strategy. https://github.com/sbt/sbt-assembly#merge-strategy
I think option 1 makes more sense.
Not getting submodule dependencies as jars in the war file is quite troublesome. Is there any way to force this plugin to include all dependencies as jars (essentially, to treat local projects the same as third-party artifacts)?
I'm not sure, but I can see how that would be useful. Let me look into it...
Alternatively you may use exportJars := true in module settings, so that webapp module will have jars instead of '/classes' directories of modules on classpath.
@earldouglas is there any update on this? I ran into the same issue, the exportJars fixed it. For me this works, another solution would be a settings key in the plugin to specify whether to jar per project or to do a merge like the sbt-one-jar plugin.
If not, is this something that should be documented at least?
have a look at https://github.com/ritschwumm/xsbt-classpath - maybe something like this could be used for xsbt-web-plugin, too.
This should be solved in version 1.0.