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.
+7
A:
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
2009-03-11 13:30:17
+1 cyclical dependencies will hurt you again and again. Finding solutions for every single problem they cause can be come very tiring.
Joachim Sauer
2009-03-11 13:32:34
Java itself fell into it. java.lang, java.io, and java.util are all one monster package.
duffymo
2009-03-11 13:35:17
A:
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
2009-03-11 13:38:12
A:
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
2009-09-14 07:45:22