Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Plugin dependency to multiple versions?

Mirko Skramusky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2014

Hi!

Is it possible to build a plugin with a dependency to any other plugin compatible to two different major versions?

The SDK builds a manifest file using the maven dependency major version. So I cannot create a plugin which is compatible to two major versions of another plugin. I tried a lot of configurations without success (e.g. Require-Bundle, Import-Package, DynamicImport-Package in pom.xml; Import-Package in atlassian-plugin.xml; using jar or obr files). In this special case I need a dependency to the Confluence Create Content plugin (Confluence bundled one), which is bundled in version 2 until CF 5.4, but in version 4 since the new CF 5.5. The error message looks like:

missing requirement [205.0] package; (&(package=com.atlassian.confluence.plugins.createcontent.actions)(version>=2.0.0)(!(version>=3.0.0)))

Any idea?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Mirko Skramusky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

The following solution seems to be working:

<Import-Package>
com.atlassian.confluence.plugins.createcontent.*;version="${create-content-plugin.version}",
    *;resolution:=optional
</Import-Package>

Note the addional "*"-package, otherwise all other imported packages thrown out. Adding "optional" was also necessary - the package identification mechanism of the Atlassian SDK also mark all packages in my plugins as optional within the generated manifest. Otherwise you get other error messages regarding dependenies during installation of the plugin.

Some documentation: https://developer.atlassian.com/display/DOCS/Managing+Dependencies#ManagingDependencies-UsingContainer-providedPackages

Hope this helps anyone running into the same problem.

lasrik September 16, 2014

The additional "*" is the solution. This helped ma a lot - although I don't have a clue why :) Thanks a lot!

1 vote
George Dinkov _Botron_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2014

Hi Mirko,

Have you tried using ImportPackage (or DynamicImportPackage) with a specified range including the two versions? As it seems by the error mesage the requirement is for versions [2.0.0,3.0.0). You may try some like this - from 2.0.0 to 5.0.0 exclusive:

<configuration>
  ...
  <instructions>
    <Import-Package>
      com.atlassian.confluence.plugins.createcontent.actions*;version="[2.0.0,5.0.0)"
    </Import-Package>
  </instructions>
</configuration>

Mirko Skramusky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

Hi George,

Thanks for you answer! In the meantime I found a solution that works. Yes, adding this is correct!!" But all other imported packages thrown out. See my answer for the complete solution.

TAGS
AUG Leaders

Atlassian Community Events