0

Imagine I have the follwoing project structure:

a -> a-api
     a-impl


b -> b-api
     b-impl

And I want the build to fail when there is a dependency "cycle" because b-impl depends (transitively) on a-api and a-impl depends on b-api (note that this is not really a cycle).

I am not allowed to define additional dependencies (e.g. in a or b) and I am searching for a build plugin/configuration where this would automatically fail.

I'm currently evaluating if this is possible with a custom rule of the enforcer plugin: http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html

pNRuag
  • 63
  • 5
  • 1
    I would suggest to take a look at: https://www.mojohaus.org/extra-enforcer-rules/banCircularDependencies.html (If I correctly understand your problem). – khmarbaise Jun 09 '20 at 20:18
  • Thanks for the hint, I already had a look at that the broblem is that my dependencies are not really circular (a -> b -> a) but they have "sibling" circularity (a-impl depends on b-api and b-impl on a-api). I need to find a way to find dependencies in my reactor projects. – pNRuag Jun 10 '20 at 16:51

0 Answers0