Plugin for prev Bitbucket version


#1

Is there an easy way to modify a plugin to support an earlier version of Bitbucket? I developed a simple plugin that works on Bitbucket v5.11.1 server but want to use the same code to support v4.10.2. I might have missed it in the docs but can I update something in pom.xml?

Thank you.


#2

Hey there!

It is not impossible to do this but you have to be really carefull because quite some stuff can break and will cause the plugin to fail. Also that version is EOL, why not upgrade to 5.11+ and save yourself some hassle?

But if you really want to do it here is some example
In your pom you will find dependencies on the bitbucket api for example. Like below:

<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-api</artifactId>
<version>5.11.1</version> <-- might be lower than 5.11.1

update the version of these to the version you would be interested in, let’s say 4.10.2. This would update the dependencies to the correct version. Now comes the tricky part, it still needs to compile because the plugin might use api’s that aren’t supported in older versions. The best way to find this out is by doing a clean install via

mvn clean install

At this point the code will compile or not and it will be a bit puzzling from here on.

There might be more dependencies you will need to downgrade but this is just an example to get you started.