views:

39

answers:

2

Inovking maven2 goal "mvn dependency:list" on an artifact pom causes to download the whole dependent artifact packages. i think only those pom files are necessary for resolving dependencies. Aren't they?

+2  A: 

On the dependecy plugin documentation you can read that dependency:list is an alias for dependency:resolve. What you need is dependency:tree which :

Displays the dependency tree for this project.

Even with dependency:tree you will have to download dependencies.

From Arnaud Héritier (developer on Maven Project)

This is a problem in maven core which doesn't allow in 2.x to resolve dependencies without downloading artifacts.

Colin Hebert
"tree" turned to download too.
sof
It turns out that it's a maven 2 bug.
Colin Hebert
Are "dependency:resolve/list/tree" goals of too little use for such bug to surface?
sof
I think they're working on it. Maybe for maven 3. But as said in the quote, it a problem in maven core, maybe not that easy to correct.
Colin Hebert
I got an exsiting maven2 project with huge maven dependencies. They're already installed locally, but certainly not in mvn local repos. After asking "maven, check what we need", i got everything doubled.
sof
That's not a bug, that's by design (what is resolving a dependency if not downloading it?).
Pascal Thivent
You can resolve dependencies by downloading the tree of dependencies pom, without downloading dependencies themselves. I don't need to download every spring dependency to know what they need, the pom.xml should suffice (and that's the OP question).
Colin Hebert
Ahhh, got the question now. But I wouldn't call that resolving, resolving means actually downloading an artifact for me.
Pascal Thivent
A: 

Each mojo (plug-in in the Apache Maven) has a functionality description. See all dependency plugin functionality.

amra