This is a very valid question, since lots of projects enforce dependencies through Maven modules, which is a huge waste of productivity and flexibility.
After spending a lot of time researching on this subject I could recommend two tools:
- Macker (http://innig.net/macker/) it has Maven plugin
- Classycle (http://classycle.sourceforge.net/) it has to be plugged-in using Ant
Both tools are not evolving much last years, but are working well. Macker has XML-based syntax, but Classycle has neat DSL. Classycle is more high-level specialized tool and has concept of layers. These tools allow you to enforce strict barriers between packages and certain class types. This tools should be configured in build process to fail upon any constraint immediately.
Check the layering example here (http://innig.net/macker/example/layering/src/macker.xml) and here (http://classycle.sourceforge.net/ddf.html#layer).
There is still a niche for a good open source tool, which would hook into compiler and would give you errors while you are in IDE rather than in build tool. Structure101 is much more feature rich, but also heavy and relies on Eclipse plugin.
Update
These is also JQAssistant, which is very powerful, but can take quite some time to learn and setup.