HI,
your question seems to be out of topic here. Anyway, let me give you a quick answer:
The answer depends on what quality and type of plugin you want to develop and deliver.
- You should be aware of general Java class loading mechanisms.
- You should know how class loading is done Jira, which is based on spring
- You should know how plugin loading and class access is provided to your plugin within jira
As far as I can see, the JSD-API is provided by the JSD application, which is not part of the Jira core but seems to run in a similar way like a plugin. Means: In case Jira core is running (which is NOT providing the JSD API) your plugin won’t start in case you are referencing “provided” services from your plugin. In case the Application JSD is running, you might be able to enable your plugin. If this behavior is acceptable and/ or desired, you can rely on injecting JSD services provided by JSD-API. If this is not the case for your plugin you need to build you own adapter and to remove all dependencies (to JSD-API) resolved during plugin enable process.
So, short summary:
If you don’t care, just go along with using direct JSD API dependency usage.
For comaptibility, use the lowest Version, you want to support with your pluign (check against the link I provided already).
E.g.: for Jira 7.3.8 and above use the following pom entries:
com.atlassian.servicedesk
jira-servicedesk-api
${jira-servicedesk-api.version}
provided
7.3.8
3.5.2
3.4.2-REL-0020
...
If you need JSD installed in your dev environment add in addtion:
.....
jira-servicedesk
${jira.servicedesk.application.version}
in you maven-jira-plugin configuration section
You can get the API-Version string by inspecting loaded OSG -modules in the OSGI console of your development environment.
Hope this helps.