You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gilles Scokart <gs...@gmail.com> on 2008/10/08 15:40:30 UTC

Reinforce dependency control

When working on some big project with heavy history and when looking
at the quality of some meta data in the maven repository I'm always
shoked by the amount of useless dependencies used.

To counter that, I would like to use (and promote) a tool that help
the developpers to limit their path to the strict minimum.

I would like to start with the easiest : the compile path.  (Next I
would try to do the same for test classpath, and maybe for runtime
classpath)
I would like to push my build to an extreme solution.  I want to make
a build fail if some jars of the compile path are not used.

Did you know a task that do that?  Or did you know any tools that list
the jars that are required by a sources (or a compiled jars) that I
could adapt to make such a tasks?

-- 
Gilles Scokart

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Reinforce dependency control

Posted by Kirby Files <kf...@masergy.com>.
Gilles Scokart wrote on 10/08/2008 09:40 AM:
> I would like to start with the easiest : the compile path.  (Next I
> would try to do the same for test classpath, and maybe for runtime
> classpath)
> I would like to push my build to an extreme solution.  I want to make
> a build fail if some jars of the compile path are not used.
> 
> Did you know a task that do that?  Or did you know any tools that list
> the jars that are required by a sources (or a compiled jars) that I
> could adapt to make such a tasks?

You could try something like AutoJar 
(http://sourceforge.net/projects/autojar/ ) to do bytecode analysis of 
class dependencies, and then identify the jars required to satisfy 
those dependencies. I could see a workable ant task being created from 
such a technique.

Thanks,
   --kirby

Re: Reinforce dependency control

Posted by Niklas Matthies <ml...@nmhq.net>.
On Wed 2008-10-08 at 15:40h, Gilles Scokart wrote on ivy-user:
:
> I would like to push my build to an extreme solution.  I want to make
> a build fail if some jars of the compile path are not used.
> 
> Did you know a task that do that?  Or did you know any tools that list
> the jars that are required by a sources (or a compiled jars) that I
> could adapt to make such a tasks?

There's JarJar's "find" functionality, which prints the dependencies
between the jars in a classpath as a list of "A.jar -> B.jar" lines.
It would be possible to implement your check on top of that.

This won't help for runtime dependencies though, due to dynamic class
loading and reflection.

Another thing is API dependencies versus implementation dependencies
(both compile-time). I think it's actually more important to restrict
the published compile-time dependencies of a module (the dependencies
needed for compiling a client against the module) to the actual
dependencies of the module's public API, as opposed to restricting the
module's private build-time compilation dependencies to the minimum.
I'm not aware of any tool that can check the former, though.

-- Niklas Matthies

Re: Reinforce dependency control

Posted by Kirby Files <kf...@masergy.com>.
Gilles Scokart wrote on 10/08/2008 09:40 AM:
> I would like to start with the easiest : the compile path.  (Next I
> would try to do the same for test classpath, and maybe for runtime
> classpath)
> I would like to push my build to an extreme solution.  I want to make
> a build fail if some jars of the compile path are not used.
> 
> Did you know a task that do that?  Or did you know any tools that list
> the jars that are required by a sources (or a compiled jars) that I
> could adapt to make such a tasks?

You could try something like AutoJar 
(http://sourceforge.net/projects/autojar/ ) to do bytecode analysis of 
class dependencies, and then identify the jars required to satisfy 
those dependencies. I could see a workable ant task being created from 
such a technique.

Thanks,
   --kirby

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org