Hi devs - I'm hoping for a pointer or two as to how easy this might be
to implement in practice - I think it shouldn't be too hard, but I'm
not really familiar with the possibly subtle interactions.

We build many WAR files in M2. We then merge these together at the
end, in order to create an 'uberwar' - this is done using the cargo
uberwar plugin, and from a dependency point of view, all it does is
that the output will contain all of the dependencies of the war
projects files in /lib.

This is good - but - there's a slightly annoying problem. If the
output is C.WAR, made from A.WAR and B.WAR.
A declares it uses X:jar:1.0, and gains a number of things from that
transitively.
B declares it uses X:jar:1.1, and gains some other things from that,
transitively.
C is the merged output, and so contains X:jar:1.0 AND X:jar:1.1 AND
any differences in transitive deps between X:jar:1.0 and X:jar:1.1.

If everything had been a JAR file, then maven does the clever
dependency analysis, and should end up with one or the other.

So - my question is - is it possible to use the maven core to get me
the 'correct' result? So instead of just keeping the contents of /lib
from A and B, re-calculating the 'correct' files to be there.

I have looked at the maven-dependency-plugin and
maven-dependency-tree, but I'm not sure I understand how to do
traversal from dependencies (or even if I'm looking at the correct
area of code to do this). I can see the ArtifactsPackagingTask in the
maven-war-plugin, but I'm not sure how I'd get to a MavenProject from
an Artifact if I needed to find dependencies recursively.. And then
apply the 'calculate effective dependencies' process ?

Has anyone got any hints (or perhaps a different plugin that does
something similar) ?

TIA,
Nigel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to