Is there way to use the jdepend plugin in maven to fail a build when package cycles exist? I know you can do it fairly easily with ant, but I haven't figured out how to do it with maven.
thanks, Jeff
Based on the accepted answer, I improved the performance and log output and released it on Maven Central:
https://github.com/andrena/no-package-cycles-enforcer-rule
(I'd comment on the accepted answer, but don't have enough rep yet.)
From what I can see, the JDepend Maven Plugin is supposed to be used to generate a report, it doesn't allow to fail the build on particular rules violations.
You could write your own rule for the maven-enforcer plugin as described in
http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html
That's how I did it.
NoPackageCyclesRule.java
pom.xml for enforcer rule:
Then you can add it to your build: