Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cyclic dependency error in maven

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am facing one problem in maven ....
I have Module A and Module B .Some java classes are required in Module B those are actually in Module A.The Module A also depends on Module B.So when am adding the dependency of Module A to Module B am getting cyclic dependency error .Could anybody give me the solution .

Thanks and regards,
Satya
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you get rid of the cyclical dependency? Introduce Module C as a jar packaged artifact that contains the common classes.
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
Thanks for the reply ... Could you please give some examples / links so that i can try to implement it .

regards,
Satya
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Create a new Maven module
2) Move the classes in module B that A replies on into it
3) Build the new module using "install" (local repository) or "deploy" (if using Nexus)
4) Add your new module as a dependency to project B
5) Build module B using "install" (local repository) or "deploy" (if using Nexus)
6) Add your new module as a dependency to project A
7) Build module A using "install" (local repository) or "deploy" (if using Nexus)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic