Assume there are two plugins P1 and P2 are available in eclipse rcp application.
Both P1 and P2 are built separately by different build process
In my scenario depending on the user's choice only p1, only p2 or both plugins are available in the base product.
I want to exchange the data between Plugin P1 and P2 when both the plugins are available, else the plugins will work with their own data.
Will OSGI declarative services work well in my scenario,
is there any way that i can expose service api's which return json or string from Plugin P1 and P2 can consume it with out depending on it explicitly, I mean, Plugin p2 should only consume it when p1 exists, if not, it should function as normal.
Kindly advice.
Edit: Thanks for you suggestion
I completely agree that having a common plugin will be ideal.
However in our case We have a base product and unfortunately we do not have control over, I mean we can add any plugin to the base repository.
Plugin P1 and P2 are 2 different products which work independently of each other but has data which can be complimented with each other. We like to make an api call from Plugin p2, if the plugin p1 is intalled on the base product and use the data to augument the existing views in p2 else show only p2 data.
I assumed, using declerative services, Plugin P2 can call the api's exposed by plugin P1 using osgi specification api's which are part of eclipse standard plugins without adding any dependency between plugins P1 and P2. Please let me know if there any option achieve this.