I have the following use case:
 
I build a war that contains common pieces of jsps etc. When I build a
variant of my product, I use the dependency plugin to download the
common war and unpack it in target/final name. The war plugin comes
along and builds my variant war on top of the unpacked war. The effect
is perfect, if a variant needs to override something in the common, the
war plugin overwrites what was unpacked. When I build the common war, I
exclude all jars to account for maven possibly resolving different
versions when the war is built (otherwise I might end up with multiple
versions of the jar in the war). The problem with this is that I need to
make sure that any dependencies of the common war are also listed in the
variant war. I effectively can't transitively include the war to pick up
its dependencies.
 
Question 1: (I think I tried this a long time ago and it didn't work) If
I include a war as a dependency, will maven transitively get those
dependencies, or is it ignored since it's a war?
 
Question 2: I was thinking about writing a plugin that would grab the
war pom and use the pombuilder (or whatever it's called, I used it in
dependency) to build a project around the pom and get the dependencies.
I could then add them to my current project directly through the pom.
The problem is, how would I handle the version resolution correctly, or
how could I kick maven to do it? (ie if the current project wants
version 2.0 and the common uses 2.1, I want to make sure maven handles
this correctly and I don't end up adding both to the list)
 
Question 3: I know the war plugin has since been modified to allow
merging of wars (this occured after I built my project around the use
case above), does it handle resolution of the jars directly or is that
perhaps overlooked and the plugin is just attempting to merge the
contents?
 
Thanks,
Brian

Reply via email to