I re-factored some of my JIRA plugins and move some core classes to the separate jar.
But now, when autowiring some interface (from that library), implemented in current plugin (and in other plugins too!) does beans from the current plugin are in priority?
So, for example, in my separate-lib.jar I have some interface A.
Then, while working on plugin, I add an implementation of A, let's call it B. And I know, that in other plugins I have (or would have) other implementations of an interface A.
For now, I suppose, that current plugin beans are in priority while autowiring. Is my guess right?
Short answer - Yes.
For example, you are creating some your custom endpoint, it is a @Component - your
plugin beans are in priority.
But if, for example, you are creating an admin-panel for your plugin.
You are doing it in a common way - implementing JiraWebActionSupport. Such classes should not be marked as @Scanned or @Component - JIRa inject dependencies itself - as long as you add @Autowired before constructor.
In such case, if some other of you plugins would have the same named class for the same purpose - in this case for admin page - than you would have problems. Context, visible from its constructor would be related to that 'other' plugin - not your current. That can be solved by renaming that implementation class.
If you know other ways to resolve the second case - your comments are very welcome. Because to multiply plugin-dependent named classes is ugly.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.