I got seemingly trivial use-case, and still I cannot figure it out. Let's take a look at the package structure.
-- CommonPackage -- Package1 ---- DAOs ---- Common ---- Service -- Package2 ---- subpackage1 ---- subpackage2
What I want to achieve is to create a rule, in which all the classes in the Package2, cannot use any of the classes from Package1 EXCEPT the common one. So far I've came with something like this:
noClasses()
.that()
.resideInAPackage("package2..")
.should()
.resideInAnyPackage("package1..")
// and how write eg. except("package1.common")
.check(classes);
But I cannot figure out how to exlude package1.common from this equasion. Can anyone help?