Adding a plugin dependency to my plugin breaks existing non-plugin library (Google Data API)

184 Views Asked by At

I'm writing an eclipse plugin. This plugin uses a few local jar files, and additionally has a few dependencies on other plugins.

I'm using the Google Code Search API from jar files, and it works fine; but after I add the plugin dependency org.eclipse.zest.dot.ui to my project, the Google Code Search API does no longer work - on calling new CodeSearchService("my_ID"), I'm getting the following run-time error:

Analysis failed: java.lang.NoSuchMethodError exception raised.

com.google.common.collect.ImmutableSet.buider()Lcom/google/common/collect/ImmutableSet$Builder;

I have carefully checked and reproduced this: if the plugin appears in the dependency list, the CodeSearchService can no longer be used; if it doesn't, it works perfectly. The actual project code does not change, only a dependency is added.

This is very strange to me, as I don't see how adding a plugin dependency should suddenly make some methods disappear. Has anyone encountered anything similar, and can share any insights about this problem and a possible solution? I'm not even sure if this issue is specific to these two libraries or not.

1

There are 1 best solutions below

0
On

The org.eclipse.zest.dot.ui bundle pulls in dependencies that depend on the Google Collections, so my guess is that the Google Code Search API requires a different version of these, and is now trying to use the other version. Not sure how to solve this, but you could try to update both to the latest version (see http://wiki.eclipse.org/Zest#Zest_2.x for the newest org.eclipse.zest.dot.ui bundle).