Bitbucket plugin

Hello Everyone,

I am trying to develop a Post-Receive Hook for Bitbucket server. My development environment is as follows:

OS – Windows 10

IDE – Intellij IDEA

Java – 1.8

SDK – Atlassian SDK 6.2.15

Maven – Atlassian provided 3.2.1

Question:

When creating the plugin, the automated plugin version is provided as 4.9.1. How can I upgrade the version to latest 5.6?

Possible solution tried:

Changed the Bitbucket server and database versions does not help and the atlas-run command ends in Build failure.

Question:

The package com.atlassian.bitbucket.ssh.does not have SshConfigurationService API by default. Trying to add maven dependency cannot find this package, however, com.atlassian.bitbucket.ssh.command API is available, but is of no direct use for my plugin.

How can I get SshConfigurationService API? Is there any special setup that is required?

Possible solution tried:

With some research I was able to find the dependency for SshConfigurationService API and could finally load that into plugin, but the version it is available at is 4.0.0-m10. Running the plugin with this dependency disables the plugin on Bitbucket server instance and no plugin modules can be loaded into the server; even though the logs suggests that the plugin was successfully deployed.

 

I can provide the specific logs if required, or an example for developing plugins for latest Bitbucket server will be good reference point.

Thanks in advance for the help,

Salil

1 answer

Use "Yet-Another-Commit-Checker" as a working example to study for inspiration.

Look for the part near the bottom of its pom.xml with these and update them to suit your target Bitbucket version:

<bitbucket.version>5.0.0</bitbucket.version>
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
<amps.version>6.3.3</amps.version>

 

Finally, these days I always invoke "atlas-run" like this:

atlas-run -u 6.3.0

I remember everyone had to do that starting with Bitbucket 5.0's rollout about a year ago.

I can't be bothered to find out if that's still necessary or why I need to do that.  Letting black boxes be black boxes is one of my super powers.

 

p.s. the bitbucket-ssh dependency looks like this in a pom.xml file:

 <dependency>
  <groupId>com.atlassian.bitbucket.server</groupId>
  <artifactId>bitbucket-ssh</artifactId>
  <scope>provided</scope>
</dependency>

 

Hi,

Thank you for your answer.

I have tried using atlas-run -u 6.3.0 with no success, however, the change you mentioned in pom.xml is certainly what i am going to try next and thank you for pointing out the git-repo for example study.

Hi G. Sylvie Davies,

Just wanted to update that i tried your solution but could get it to work.

Thanks for your response.

Regards,

Salil

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,345 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you