components-example
components-example copied to clipboard
Avoid cyclic references
Outline the problem
Let's assume the project is expanded with a new component: car-mechanic. If this module tries to use the check-engine module and vice-versa, the Maven lifecycle will be broken because it is a cyclic reference between components. It can be happened between sub-components also.
Possible solution
A possible solution could be a standalone Maven/Gradle module for the component/sub-component api within the domain-related module. The standalone api module could be enough for adding it as a dependency to the other internal components. api components should be other api-dependency-free modules if it doesn't contain value objects. (The question of the value objects and their places could be another topic)