Marking Packages as Optional Imports

Unless you plan to list every single package your plugin needs, be sure to add the *;resolution:=optional value to your list of packages, when including bundle instructions in your plugin atlassian-plugin.xml XML.

Example:

<plugin ...>
  <plugin-info>
    <bundle-instructions>
      <Import-Package>com.mylibrary,*;resolution:=optional</Import-Package>
    </bundle-instructions>
  </plugin-info>
  ...
</plugin>

The *;resolution:=optional value instructs the plugin system to continue to scan your classes for packages, but to resolve all packages optionally. This means if you bundle a library that has code that depends on other libraries you do not need, the resolution will not fail.

If, however, you are sure your code only refers to packages you need, you can omit the ;resolution:=optional string. The advantage here is that you will be notified on installation if required dependencies are missing.

RELATED TOPICS

Creating your Plugin Descriptor

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport