With ArchUnit we can add a rule like this:
slices()
.matching("«pattern-to-be-defined»")
.should()
.beFreeOfCycles()
//.ignoreDependency(alwaysTrue(), simpleNameEndingWith("Repository"))
.because("Cyclic dependencies should be prevented.");
The ignore is just some thought as example if e.g. two components both call their own repository and the foreign one.
While I still think this should be architecture validation but if for some reasons component cut was designed wrong, one should have some hint how to deal with this. However, we should most probably address such excuses via some own documentation with deep-links to ArchUnit exclusion/ignore features.
With ArchUnit we can add a rule like this:
The ignore is just some thought as example if e.g. two components both call their own repository and the foreign one.
While I still think this should be architecture validation but if for some reasons component cut was designed wrong, one should have some hint how to deal with this. However, we should most probably address such excuses via some own documentation with deep-links to ArchUnit exclusion/ignore features.