Another solution: I created a dependency-checker.cfg and .sh file that looks for my dependencies in the wrong places and fails if it finds any violations.
It's not as elegant as a checkstyle rule but is a starting point and I'll figure out the checkstyle.
Hey, if you and the rest of your team would like to connect on linkedin I'd love to have you in my network!
That's not going to work for the same reason.
classpathDependencyExcludes removes a jar from the classpath, and you
need the jar in the classpath, at least in most circumstances. A
custom checkstyle rule might solve your problem, but you can't do it
by changing the classpath.