I am developing a plugin for Bitbucket DC 9.6. My question is, if a bundle exports a package (in my case the System Bundle and Atlassian - Spring 5.3.39-atlassian-4 bundle), can that package be imported by the plugin? I also read about platform-public-api… Are only those packages/artifacts available to plugins that are registered there?
Yes, your plugin can import any package exported by another bundle (like the System Bundle or Atlassian’s Spring bundle), as long as it’s exported and visible in the OSGi container. However, for stability and support:
Use only documented public APIs:
This includes both Atlassian’s platform-public-api and Bitbucket DC’s own public APIs (e.g., com.atlassian.bitbucket.repository.*). These are safe and supported for plugin development.
Avoid internal or undocumented packages:
Anything under .internal. or .dmz. or not in the Bitbucket Java API docs may change without notice and isn’t supported.
You must also declare your imports in your plugin’s manifest.