I'm looking for a tool to integrate into a maven build that will be capable of enforcing the following rules:
- No circular dependency among packages is allowed
- No parent package can depend on any sub-package (only vice-versa)
- No circular dependencies allowed among branches of the package hierarchy (subsumes rule 1). E.g., if package a.b.c depends on a.d.e.f, then none of a.d, a.d.e, a.d.e.f can depend on a.b (or a.b.c), including transitive dependencies.
The idea is that any subtree of the package hierachy can be considered to be a component, and cycles among componenents will be forbidden.
I looked at JDepend, but it seems it does not have the flexibility to enforce these constraints with its standard configuration parameters. Is there a tool for this, or do I have to write this myself? Is there any tool that would at least help by computing the dependency graph and allow me to add my own plugin to check the graph?