Last updated Apr 19, 2024

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:

1
2
<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.

Creating your Plugin Descriptor

Rate this page: