I have to build two eclipse-plugin projects into two separate jars with each one dependent on the other for compiling. Eclipse IDE complains about "cyclical dependency...". How do I build these plugin jars? I guess running these plugins by just putting them in the eclipse/plugin folder should be smooth.
Asked
Active
Viewed 910 times
3 Answers
7
If you have a cyclic dependency, you have two choices:
- You can get rid of it by putting them into one JAR. If they truly depend on each other, they really are just one entity.
- You can split out the packages that cause the cyclic dependency into a third JAR and deploy two plug-ins with two JARs each.

duffymo
- 305,152
- 44
- 369
- 561
-
+1 cyclical dependencies will hurt you again and again. Finding solutions for every single problem they cause can be come very tiring. – Joachim Sauer Mar 11 '09 at 13:32
-
Java itself fell into it. java.lang, java.io, and java.util are all one monster package. – duffymo Mar 11 '09 at 13:35
0
Or you can do a maven approach, where you deploy a versioned jar to the repository.
Then project A depends on the latest released version of B in the repository and B depends on the latest version of A in the repository.

Thorbjørn Ravn Andersen
- 73,784
- 33
- 194
- 347
0
If (and only if) you really cannot get rid of this cyclical dependency, You could use a loose form of dependency between your plugins: DynamicImport-Package
(as suggested in this blog entry, with an emphasis on getting rid of the cycle though)

VonC
- 1,262,500
- 529
- 4,410
- 5,250