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