java - Is there any way to get around circular dependencies in Maven modules? -
i have 2 modules in package, call them module1
, module2
. module1
has dependency on module2
, prefer leave alone (part of legacy code don't want break).
there class part of module1
need use in module2
- call class1
. there couple wrapper objects around , don't care if live in module1
or module2
. problem module1
depends on module2
can't add dependency module2
on module1
. there way @ access class1
inside module2
? suspect not i'm not sure how go designing feature without dependencies in direction (i've been thinking interfaces, factories , adding third module).
any tips on designing doesn't happen? if matters, java/groovy project.
if having cyclic dependency in projects, due bad design or issue in logical grouping of classes.
you can create new project , merge classes both modules in it, if logically/functionally related each other. can use intelij analyse tool find such cyclic dependent classes , improve design.
Comments
Post a Comment