Upgrade plugins code to latest API version

plugin-sdk
plugin
plugin-development

#1

I have inherited a rather large atlassian plugin project. The maven project has many submodules, builds multiple separate plugins that use each other too via osgi. The project was made for a version that’s now end of life, and I’ve got the task to upgrade the code to the latest version. The code uses spring extensively, and osgi with scanner v1.

Can I use scanner v1 with the latest atlassian code?

How should I go about the upgrade? I don’t find any documentation about this. I think the steps I should take should be something like this:

  • get the latest atlassian sdk
  • bump versions in the pom.xml files (sdk, used atlassian server etc)
  • replace the deprecated / removed API calls
  • bump all the third party libraries (mainly spring ones) that the atlassian server provide to the exact version I can find on the server, with provided scope of course
  • bump the rest of the third party libraries (not provided by the server) to the newest if possible
  • check the dependencies with maven dependency:tree

and hope for the best?

Any thoughts on this? Any tutorials / howtos etc?
thank you


#2

Dear @Gonoszpok,

Yes, you can use Spring Scanner v1 with the latest version. But if you target Bamboo further than 5.14+ you can upgrade to Spring Scanner v2 as well. See here for more information: https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/

About you steps: I think I would take the same steps to tackle the problem.

Regards,
Alexander


#3

Thanks for the scanner info @alexander.kueken , I’ll leave it at scanner v1 for now then, I have enough problems without changing that one too.

I’m targeting Bamboo latest, version 6.6.2.

I tried to perform the steps I outlined above, but I get weird errors, osgi “not resolved ones”, and ClassNotFoundExceptions too, and the plugins are grayed out / disabled after install. I think the real problem is that some Bamboo API return objects use different library versions than the version I set in the pom.xml (I suspect the spring ones, but there are tons of them). I tried to get the versions (to be used by our plugins) through the plugin manager/osgi page in the bamboo admin section, using system bundle, plus I looked directly in the bamboo server directory tree. As far as I can see, bamboo 6.6.2 server uses mainly spring 5.0.6, I’ll try to use that one in the plugin too.

Plus I’ll have to manually check all the pom.xml files for missing scope/provided dependencies.

The log file at the bamboo server is not much of a help, there are few osgi log entries, the ClassNotFoundException too is not helping much, it’s hard to find out exactly which library versions are to blame… Is there a better way to do this?