You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrés Viedma <an...@gmail.com> on 2006/12/20 02:30:12 UTC

[m2 plugin] Obtaining dependencies tree

Hi all,

I'm developing a plugin and I need to know if one of the target project
dependencies depends on another one.

I've seen that a MavenProject object contains a list of Artifact objects
which contains a "dependency trail", but the problem is that this trail
misses the information of "duplicated" dependencies. For example, if we have
three projects a, b, c, with these dependencies:
a -> b
a -> c
b -> c

The list of Artifact's for project "a" (with each dependency trail), is:
b (a -> b)
c (a -> c)

The b->c dependency has been lost, and so I can't know if there's a
relationship between b and c.

So, my question is: how can I know, when running a mojo, if one of my
dependencies depends on another one?.

Thanks in advance,

Andrés

Re: [m2 plugin] Obtaining dependencies tree

Posted by Mark Hobson <ma...@gmail.com>.
On 28/12/06, franz see <fr...@gmail.com> wrote:
> Good day to you, Andrés,
>
> The maven-dependency-plugin generates a nice dependency tree report but like
> you said, it cannot show you duplicated depenendencies.
>
> You can however use the -X option and trace through the debug logs. You can
> see there when it sees a duplication, and how it resolves it ( or at least,
> which one it will use ).

Yep, I'd like to see help:dependencies provide this functionality,
perhaps via a property.  Feel free to raise an issue for it.

Mark

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


Re: [m2 plugin] Obtaining dependencies tree

Posted by franz see <fr...@gmail.com>.
Good day to you, Andrés,

The maven-dependency-plugin generates a nice dependency tree report but like
you said, it cannot show you duplicated depenendencies.

You can however use the -X option and trace through the debug logs. You can
see there when it sees a duplication, and how it resolves it ( or at least,
which one it will use ).

Cheers,
Franz


Andrés Viedma wrote:
> 
> Hi all,
> 
> I'm developing a plugin and I need to know if one of the target project
> dependencies depends on another one.
> 
> I've seen that a MavenProject object contains a list of Artifact objects
> which contains a "dependency trail", but the problem is that this trail
> misses the information of "duplicated" dependencies. For example, if we
> have
> three projects a, b, c, with these dependencies:
> a -> b
> a -> c
> b -> c
> 
> The list of Artifact's for project "a" (with each dependency trail), is:
> b (a -> b)
> c (a -> c)
> 
> The b->c dependency has been lost, and so I can't know if there's a
> relationship between b and c.
> 
> So, my question is: how can I know, when running a mojo, if one of my
> dependencies depends on another one?.
> 
> Thanks in advance,
> 
> Andrés
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2-plugin--Obtaining-dependencies-tree-tf2857435s177.html#a8073691
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2 plugin] Obtaining dependencies tree

Posted by Andrés Viedma <an...@gmail.com>.
2006/12/20, Mark Hobson <ma...@gmail.com>:
>
> On 20/12/06, Andrés Viedma <an...@gmail.com> wrote:
> > Hi all,
> >
> > I'm developing a plugin and I need to know if one of the target project
> > dependencies depends on another one.
> >
> > I've seen that a MavenProject object contains a list of Artifact objects
> > which contains a "dependency trail", but the problem is that this trail
> > misses the information of "duplicated" dependencies. For example, if we
> have
> > three projects a, b, c, with these dependencies:
> > a -> b
> > a -> c
> > b -> c
> >
> > The list of Artifact's for project "a" (with each dependency trail), is:
> > b (a -> b)
> > c (a -> c)
> >
> > The b->c dependency has been lost, and so I can't know if there's a
> > relationship between b and c.
> >
> > So, my question is: how can I know, when running a mojo, if one of my
> > dependencies depends on another one?.
>
> Sounds like you need maven-dependency-tree [1] - see help:dependencies
> mojo [2] for example usage.



I could see these plugins at least and I'm afraid it's not what I need. In
my previous example with artifacts a, b, c, maven-dependency-tree would
build a tree like this:

a
-> b
-> c

but dependency b -> c is lost. Is there another way which doesn't lose
"duplicated" dependencies?

Andrés

Re: [m2 plugin] Obtaining dependencies tree

Posted by Andrés Viedma <an...@gmail.com>.
El 20/12/2006 12:26, Mark Hobson escribió:
> On 20/12/06, Andrés Viedma <an...@gmail.com> wrote:
>> Hi all,
>>
>> I'm developing a plugin and I need to know if one of the target project
>> dependencies depends on another one.
>> (...)
>
> Sounds like you need maven-dependency-tree [1] - see help:dependencies
> mojo [2] for example usage.

Thanks, Mark! It looks great

Andrés



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


Re: [m2 plugin] Obtaining dependencies tree

Posted by Mark Hobson <ma...@gmail.com>.
On 20/12/06, Andrés Viedma <an...@gmail.com> wrote:
> Hi all,
>
> I'm developing a plugin and I need to know if one of the target project
> dependencies depends on another one.
>
> I've seen that a MavenProject object contains a list of Artifact objects
> which contains a "dependency trail", but the problem is that this trail
> misses the information of "duplicated" dependencies. For example, if we have
> three projects a, b, c, with these dependencies:
> a -> b
> a -> c
> b -> c
>
> The list of Artifact's for project "a" (with each dependency trail), is:
> b (a -> b)
> c (a -> c)
>
> The b->c dependency has been lost, and so I can't know if there's a
> relationship between b and c.
>
> So, my question is: how can I know, when running a mojo, if one of my
> dependencies depends on another one?.

Sounds like you need maven-dependency-tree [1] - see help:dependencies
mojo [2] for example usage.

Mark

[1] http://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-tree/
[2] http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DependenciesMojo.java

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