You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nigel Magnay <ni...@gmail.com> on 2008/01/15 15:15:56 UTC

mojo cookbook; resolving transitively

The Mojo Developer Cookbook
(http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook)
is great.

In it, there's a section on "Resolving Transitively". This works great
- however, the artifact set that is resolved is based on Maven's idea
of which graph edges ought to be considered for resolution.

For example, if I have a WAR file, then any declared dependencies that
are JARs (and POM I think) are included, and those artifacts have
their dependencies added to the list (and so on, recursively). The end
result resolves to a single version for each JAR artifact.

However - if the WAR file has a WAR dependency, then it will not be
considered, and any JAR files in there won't be included in the set
that the version is resolved in.

This is the behaviour that I want, where I have a WAR of WARs, and I
want to calculate the resolved set of dependencies.

a) How can I interject my own requirements for dependency traversal?
b) Is / how is this changed in 2.1 - all the methods on
ArtifactResolver have been condensed down into 1..

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: mojo cookbook; resolving transitively

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
Jeff MAURY wrote:
> On Jan 15, 2008 3:15 PM, Nigel Magnay <ni...@gmail.com> wrote:
> 
>> The Mojo Developer Cookbook
>> (http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook)
>> is great. 
>> 
>> In it, there's a section on "Resolving Transitively". This works
>> great - however, the artifact set that is resolved is based on
>> Maven's idea of which graph edges ought to be considered for
>> resolution. 
>> 
>> For example, if I have a WAR file, then any declared dependencies
>> that are JARs (and POM I think) are included, and those artifacts
>> have their dependencies added to the list (and so on, recursively).
>> The end result resolves to a single version for each JAR artifact.
>> 
>> However - if the WAR file has a WAR dependency, then it will not be
>> considered, and any JAR files in there won't be included in the set
>> that the version is resolved in.
> 
> This is not what I have from my experience. If a WAR POM has
> a dependency of
> type war, then then content of this dependency will be copied
> verbatim to the target folder.

This was not about a *copy* it was about *resolution*. If the dependend war contains foo-1.2 and the local one depends on foo-1.3 you end up with both.

>> This is the behaviour that I want, where I have a WAR of WARs, and I
>> want to calculate the resolved set of dependencies.

We always exclude WEB-INF/lib/*.* from the dependend wars and redeclare the deps.
 
>> a) How can I interject my own requirements for dependency traversal?
>> b) Is / how is this changed in 2.1 - all the methods on
>> ArtifactResolver have been condensed down into 1..

See also MWAR-33 for discussion and workarounds.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mojo cookbook; resolving transitively

Posted by Jeff MAURY <je...@jeffmaury.com>.
On Jan 15, 2008 3:15 PM, Nigel Magnay <ni...@gmail.com> wrote:

> The Mojo Developer Cookbook
> (http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook)
> is great.
>
> In it, there's a section on "Resolving Transitively". This works great
> - however, the artifact set that is resolved is based on Maven's idea
> of which graph edges ought to be considered for resolution.
>
> For example, if I have a WAR file, then any declared dependencies that
> are JARs (and POM I think) are included, and those artifacts have
> their dependencies added to the list (and so on, recursively). The end
> result resolves to a single version for each JAR artifact.
>
> However - if the WAR file has a WAR dependency, then it will not be
> considered, and any JAR files in there won't be included in the set
> that the version is resolved in.

This is not what I have from my experience. If a WAR POM has a dependency of
type war, then then content of this dependency will be copied verbatim to
the target folder.

Jeff

>
>
> This is the behaviour that I want, where I have a WAR of WARs, and I
> want to calculate the resolved set of dependencies.
>
> a) How can I interject my own requirements for dependency traversal?
> b) Is / how is this changed in 2.1 - all the methods on
> ArtifactResolver have been condensed down into 1..
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com