Alright so I've been tackling this today and I wanted to share what I gathered so far:
Regarding maven artifact I choose to go with separation by version (and only that), I deemed this as the most logical choice among the three, if/when I am proven wrong or have more insight I will update.
As for avoiding duplicate code I started going with choice number three, but then realized the very obvious: Even the core artifact has to declare it's dependency on some (major) version of Jive.
So to counter that I thought of three things:
- Abandon this approach (Shared core)
- Depend on the lower Jive version (i.e. 4.5) and realize the plugin is broken due to API changes partially in compile time partially in runtime.
- Have the core artifact independent of any Jive version but build your own layer of separation. Let the core depend on it and have one adapter for each (major) Jive version.
I immediately eliminated number 2, and while 3 is a decent option the added up overhead is just not worth it (In my option, for my use case). To conclude I have decided to use a filesystem symbolic link I will let you know how that works out.
About configuration I went with complete separation, again this seemed as the most logical choice to me, if/when I am proven wrong I will update.
Please don't hesitate to give any remarks or ask any questions.
Wish I had some awesome solution to this issue, but you are correct. It is difficult, especially when you are not in control of all the dependencies. I try to keep an towards moving forward...and tend to not re-visit plugins from previous versions, unless specifically requested. Simply change the version number and branch the code. This way backporting is easier. Hope this helps.