Conflicting files in multi-module packaging #111

Closed
chris-martin opened this Issue May 24, 2013 · 6 comments

5 participants

@chris-martin

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:

Files are lost

With the default setting classesAsJar in Compile := false, the war contains one of the reference.conf files, chosen apparently arbitrarily.

Packaging fails

With the setting classesAsJar in Compile := true, the package task fails.

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.

@earldouglas earldouglas was assigned Jun 5, 2013
@chris-martin

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)?

@earldouglas
Owner

I'm not sure, but I can see how that would be useful. Let me look into it...

@fedgehog

Alternatively you may use exportJars := true in module settings, so that webapp module will have jars instead of '/classes' directories of modules on classpath.

@elm-

@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?

@ritschwumm

have a look at https://github.com/ritschwumm/xsbt-classpath - maybe something like this could be used for xsbt-web-plugin, too.

@earldouglas earldouglas modified the milestone: 0.10.0, 0.5.0 Apr 2, 2014
@earldouglas earldouglas removed this from the 0.10.0 milestone Apr 13, 2014
@earldouglas earldouglas added this to the 1.0.0 milestone Jul 14, 2014
@earldouglas earldouglas referenced this issue Jul 14, 2014
Closed

Fix the documentation #153

4 of 10 tasks complete
@earldouglas
Owner

This should be solved in version 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment