Hi There,
There is a plugin that provides a component for integration. I want to communicate with that. So, What I need to communicate with that? I need to add the dependency on the pom.xml, but if the plugin that I want to communicate is not installed? I want that my plugin works if the other plugin is not installed.
Thank you.
Cheer,
RMRodrigues
Community moderators have prevented the ability to post new answers.
Hi,
There is an excellent presentation by an Atlassian engineer on how to bundle and deploy cross-plugin dependencies. It's called "You've got plugins in your plugins: Bundling Plugin Dependencies" and in my opinion it's the best way to learn how to do this from scratch, rather than reading the documentation on this stuff.
https://summit.atlassian.com/archives/2012/plugin-dev/plugins-in-your-plugins
Hi @Joe Clark [Atlassian] , Thank you for your answer. I would like to know if it's possible to install my plugin(it depends of other plugin) without the other plugin to be installed on JIRA. I don't want to install it. Thank you. Cheers, RMRodrigues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you watch the presentation, it will show you how to embed the other plugin _inside_ your plugin so that it will be installed automatically. If you want your plugin to function even when the other plugin is not present, then you will need to lazy-load your dependencies on the other plugin. You can do this by following this guide: https://developer.atlassian.com/docs/faq/advanced-plugin-development-faq/detecting-the-presence-or-absence-of-classes-in-different-osgi-bundles Even though it has a warning at the top, it is still the most reliable way of doing this that I'm aware of.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. It's almost perfect. I've a problem. When my plugin is installed and the other is being installed, the setBundleContext is invoked and a ClassNotFoundException occurs because that class belongs to other plugin. I've a dependency of other plugin on my pom.xml but the scope is "provided". Any Suggestion? Cheers, RMRodrigues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your setBundleContext method, you cannot refer to the class in the other plugin until you are certain that the other plugin has been installed (for example, in the "addingService" method). Otherwise you will get a ClassNotFoundException.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph. I'm using that: public Object addingService(ServiceReference serviceReference) { logger.info("addingService"); setEnabled(true); return (ServiceFromAnotherPlugin) bundleContext.getService(serviceReference); } When the method addingService is invoked a ClassNotFoundException is thrown. ServiceFromAnotherPlugin is the service that belongs to the other plugin. It occurs when the other plugin is installed. Many thanks for your feedback. Cheers, RMRodrigues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Joseph, There is another problem. When the other plugin is uninstalled my plugin is disabled. Is that normal? Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The page at https://developer.atlassian.com/docs/faq/advanced-plugin-development-faq/detecting-the-presence-or-absence-of-classes-in-different-osgi-bundles highlighted that the approach has a problem, and Atlasssian is working for a better solution.
May I know what is the problem by using this approach, and is there a better solution is found?
Thanks in advance
Leon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.