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?
Community moderators have prevented the ability to post new answers.
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.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.