You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ben Caradoc-Davies <Be...@csiro.au> on 2010/07/20 06:39:37 UTC

Reverse dependency:tree?

Is there a plugin or command-line tool that can list all artifacts in a 
local repository (or even in a multimodule project) that depend, 
directly or transitively, on a given artifact? This is the opposite of 
dependency:tree, which only displays dependencies.

Maven Dependency Browser is no longer maintained and is a GUI. IDE 
plugins seem like overkill.

The problem I am trying to solve is to automatically determine which 
higher level artifacts need to have their dependencies updated when a 
lower level artifact is updated. Extra credit for being as simple and 
easy-to-use as dependency:tree.  :-)

-- 
Ben Caradoc-Davies <Be...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

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


Re: Reverse dependency:tree?

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 20/07/2010 5:53 AM, Ben Caradoc-Davies wrote:
> On 20/07/10 14:50, Barrie Treloar wrote:
>> On Tue, Jul 20, 2010 at 2:09 PM, Ben Caradoc-Davies
>> <Be...@csiro.au>  wrote:
>>> The problem I am trying to solve is to automatically determine which 
>>> higher
>>> level artifacts need to have their dependencies updated when a lower 
>>> level
>>> artifact is updated. Extra credit for being as simple and 
>>> easy-to-use as
>>> dependency:tree.  :-)
>>
>> Why do you want this?
>> Dont you want control over when to upgrade your dependencies?
>
> Yes. I have large projects with deep dependency trees. If I change a 
> low-level artifact and want to apply this effect everywhere, I need to 
> know which artifacts to change (the ones that consume it directly or 
> indirectly). I want to display the dependency graph so I know which 
> artifacts to change.
>
One way to minimize some of the effects of low level changes is to build 
projects that aggregate common dependencies.
We have done this with success for both internal and external libraries.
The application level jars do not depend on the low level artifacts. 
Instead, they depend on an aggregation project that identifies a set of 
lower level artifacts and builds an aggregated jar.
This way the application author does not have to worry about which 
version of the lower level artifacts but just depends on the correct 
version of the aggregated project.
It ensures that applications are built using a single version of an 
artifact. Once the person planning the application decides that 
application version y will require x version of commons-logging, 
everyone gets it automatically by depending on the y version of the 
our-apache project which will define that version x of commons-logging 
is to be used.

It also makes the application levels POMs very small and very stable.

Ron

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


Re: Reverse dependency:tree?

Posted by Ben Caradoc-Davies <Be...@csiro.au>.
On 20/07/10 14:50, Barrie Treloar wrote:
> On Tue, Jul 20, 2010 at 2:09 PM, Ben Caradoc-Davies
> <Be...@csiro.au>  wrote:
>> The problem I am trying to solve is to automatically determine which higher
>> level artifacts need to have their dependencies updated when a lower level
>> artifact is updated. Extra credit for being as simple and easy-to-use as
>> dependency:tree.  :-)
>
> Why do you want this?
> Dont you want control over when to upgrade your dependencies?

Yes. I have large projects with deep dependency trees. If I change a 
low-level artifact and want to apply this effect everywhere, I need to 
know which artifacts to change (the ones that consume it directly or 
indirectly). I want to display the dependency graph so I know which 
artifacts to change.

-- 
Ben Caradoc-Davies <Be...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

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


Re: Reverse dependency:tree?

Posted by Barrie Treloar <ba...@gmail.com>.
On Tue, Jul 20, 2010 at 2:09 PM, Ben Caradoc-Davies
<Be...@csiro.au> wrote:
> Is there a plugin or command-line tool that can list all artifacts in a
> local repository (or even in a multimodule project) that depend, directly or
> transitively, on a given artifact? This is the opposite of dependency:tree,
> which only displays dependencies.
>
> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
> seem like overkill.
>
> The problem I am trying to solve is to automatically determine which higher
> level artifacts need to have their dependencies updated when a lower level
> artifact is updated. Extra credit for being as simple and easy-to-use as
> dependency:tree.  :-)

Why do you want this?

Dont you want control over when to upgrade your dependencies?

If these are your own projects then you should know when the
dependencies have changed.

Hudson may have some code that could be harvested for this purpose.
It is able to know that Project B needs to be rebuilt if it depends on
Project A and A has been rebuilt recently.

Doing this for your local repo would be an intensive task.  There is
no meta-data for this reverse mapping.
My local repo currently has 2500 files in it (if we assume pom, jar,
source, so divide by 3, then there are 800+ pom files to parse)

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


Re: Reverse dependency:tree?

Posted by Anders Hammar <an...@hammar.net>.
I believe it has been discussed in the nexus user mailing list and IIRC it
is a planned feature, but it requires some Maven 3 features I think.

/Anders

On Wed, Jul 21, 2010 at 00:51, Ron Wheeler
<rw...@artifact-software.com>wrote:

>  It would seem like a useful function on a repository and a lot less stuff
> to check out.
> Have you asked this in the Nexus forum?
>
>
> On 20/07/2010 2:28 AM, Wim Deblauwe wrote:
>
>> I don't know of such a tool, but if you are running linux, you could
>> create
>> a shell script that relies on dependency:tree. You would need to check out
>> all the projects you want to monitor, run dependency:tree (or
>> dependency:list) on them with a grep on the artifact and print out those
>> that match. You probably don't even need to use grep, I think there are
>> some
>> options to tweak the plugin to only print the dependency you look for.
>>
>> regards,
>>
>> Wim
>>
>> 2010/7/20 Ben Caradoc-Davies<Be...@csiro.au>
>>
>>  Is there a plugin or command-line tool that can list all artifacts in a
>>> local repository (or even in a multimodule project) that depend, directly
>>> or
>>> transitively, on a given artifact? This is the opposite of
>>> dependency:tree,
>>> which only displays dependencies.
>>>
>>> Maven Dependency Browser is no longer maintained and is a GUI. IDE
>>> plugins
>>> seem like overkill.
>>>
>>> The problem I am trying to solve is to automatically determine which
>>> higher
>>> level artifacts need to have their dependencies updated when a lower
>>> level
>>> artifact is updated. Extra credit for being as simple and easy-to-use as
>>> dependency:tree.  :-)
>>>
>>> --
>>> Ben Caradoc-Davies<Be...@csiro.au>
>>> Software Engineering Team Leader
>>> CSIRO Earth Science and Resource Engineering
>>> Australian Resources Research Centre
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>

Re: Reverse dependency:tree?

Posted by Ron Wheeler <rw...@artifact-software.com>.
  It would seem like a useful function on a repository and a lot less 
stuff to check out.
Have you asked this in the Nexus forum?


On 20/07/2010 2:28 AM, Wim Deblauwe wrote:
> I don't know of such a tool, but if you are running linux, you could create
> a shell script that relies on dependency:tree. You would need to check out
> all the projects you want to monitor, run dependency:tree (or
> dependency:list) on them with a grep on the artifact and print out those
> that match. You probably don't even need to use grep, I think there are some
> options to tweak the plugin to only print the dependency you look for.
>
> regards,
>
> Wim
>
> 2010/7/20 Ben Caradoc-Davies<Be...@csiro.au>
>
>> Is there a plugin or command-line tool that can list all artifacts in a
>> local repository (or even in a multimodule project) that depend, directly or
>> transitively, on a given artifact? This is the opposite of dependency:tree,
>> which only displays dependencies.
>>
>> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
>> seem like overkill.
>>
>> The problem I am trying to solve is to automatically determine which higher
>> level artifacts need to have their dependencies updated when a lower level
>> artifact is updated. Extra credit for being as simple and easy-to-use as
>> dependency:tree.  :-)
>>
>> --
>> Ben Caradoc-Davies<Be...@csiro.au>
>> Software Engineering Team Leader
>> CSIRO Earth Science and Resource Engineering
>> Australian Resources Research Centre
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


Re: Reverse dependency:tree?

Posted by Wim Deblauwe <wi...@gmail.com>.
I don't know of such a tool, but if you are running linux, you could create
a shell script that relies on dependency:tree. You would need to check out
all the projects you want to monitor, run dependency:tree (or
dependency:list) on them with a grep on the artifact and print out those
that match. You probably don't even need to use grep, I think there are some
options to tweak the plugin to only print the dependency you look for.

regards,

Wim

2010/7/20 Ben Caradoc-Davies <Be...@csiro.au>

> Is there a plugin or command-line tool that can list all artifacts in a
> local repository (or even in a multimodule project) that depend, directly or
> transitively, on a given artifact? This is the opposite of dependency:tree,
> which only displays dependencies.
>
> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
> seem like overkill.
>
> The problem I am trying to solve is to automatically determine which higher
> level artifacts need to have their dependencies updated when a lower level
> artifact is updated. Extra credit for being as simple and easy-to-use as
> dependency:tree.  :-)
>
> --
> Ben Caradoc-Davies <Be...@csiro.au>
> Software Engineering Team Leader
> CSIRO Earth Science and Resource Engineering
> Australian Resources Research Centre
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Reverse dependency:tree?

Posted by Wim Deblauwe <wi...@gmail.com>.
I don't know of such a tool, but if you are running linux, you could create
a shell script that relies on dependency:tree. You would need to check out
all the projects you want to monitor, run dependency:tree (or
dependency:list) on them with a grep on the artifact and print out those
that match. You probably don't even need to use grep, I think there are some
options to tweak the plugin to only print the dependency you look for.

regards,

Wim

2010/7/20 Ben Caradoc-Davies <Be...@csiro.au>

> Is there a plugin or command-line tool that can list all artifacts in a
> local repository (or even in a multimodule project) that depend, directly or
> transitively, on a given artifact? This is the opposite of dependency:tree,
> which only displays dependencies.
>
> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
> seem like overkill.
>
> The problem I am trying to solve is to automatically determine which higher
> level artifacts need to have their dependencies updated when a lower level
> artifact is updated. Extra credit for being as simple and easy-to-use as
> dependency:tree.  :-)
>
> --
> Ben Caradoc-Davies <Be...@csiro.au>
> Software Engineering Team Leader
> CSIRO Earth Science and Resource Engineering
> Australian Resources Research Centre
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


Re: Reverse dependency:tree?

Posted by Wendy Smoak <ws...@gmail.com>.
On Tue, Jul 20, 2010 at 12:39 AM, Ben Caradoc-Davies
<Be...@csiro.au> wrote:
> Is there a plugin or command-line tool that can list all artifacts in a
> local repository (or even in a multimodule project) that depend, directly or
> transitively, on a given artifact? This is the opposite of dependency:tree,
> which only displays dependencies.

Probably also overkill, but Apache Archiva displays the artifacts
"Used By" the one you are viewing.  I think it's only one level up
though.

It wouldn't take too much to start up an instance and point it at your
local repo to index and see if that helps any.

Then if you find it useful, I'm sure the code could be pulled out to
use at the command line instead.

-- 
Wendy

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


Re: Reverse dependency:tree?

Posted by Ben Caradoc-Davies <Be...@csiro.au>.
On 20/07/10 23:20, Andrew Close wrote:
> On Mon, Jul 19, 2010 at 11:39 PM, Ben Caradoc-Davies
> <Be...@csiro.au>  wrote:
>> Is there a plugin or command-line tool that can list all artifacts in a
>> local repository (or even in a multimodule project) that depend, directly or
>> transitively, on a given artifact? This is the opposite of dependency:tree,
>> which only displays dependencies.
>>
>> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
>> seem like overkill.
>>
>> The problem I am trying to solve is to automatically determine which higher
>> level artifacts need to have their dependencies updated when a lower level
>> artifact is updated. Extra credit for being as simple and easy-to-use as
>> dependency:tree.  :-)
>
> would the versions plugin do what you want or at least help out?  it
> will tell you that new versions of artifacts you depend on are
> available in your repository.
>
> http://mojo.codehaus.org/versions-maven-plugin/

Andrew, I have started using versions:display-dependency-updates and it 
just what I needed! Thanks very much.

Kind regards,

-- 
Ben Caradoc-Davies <Be...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

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


Re: Reverse dependency:tree?

Posted by Andrew Close <ac...@gmail.com>.
On Mon, Jul 19, 2010 at 11:39 PM, Ben Caradoc-Davies
<Be...@csiro.au> wrote:
> Is there a plugin or command-line tool that can list all artifacts in a
> local repository (or even in a multimodule project) that depend, directly or
> transitively, on a given artifact? This is the opposite of dependency:tree,
> which only displays dependencies.
>
> Maven Dependency Browser is no longer maintained and is a GUI. IDE plugins
> seem like overkill.
>
> The problem I am trying to solve is to automatically determine which higher
> level artifacts need to have their dependencies updated when a lower level
> artifact is updated. Extra credit for being as simple and easy-to-use as
> dependency:tree.  :-)

would the versions plugin do what you want or at least help out?  it
will tell you that new versions of artifacts you depend on are
available in your repository.

http://mojo.codehaus.org/versions-maven-plugin/


-- 
Andrew Close

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