How can I resolve "org.postgresql.Driver" not found in my bitbucket server plugin? Edited

I'm writing a bitbucket server plugin that writes to an external postgresql DB. I'm using PostgreSQL JDBC and getting the following error when calling  Class.forName("org.postgresql.Driver") :

java.lang.ClassNotFoundException: org.postgresql.Driver not found

I've tried adding the following to my pom.xml but it results in the plugin failing to install:


How can I write to an external PostgreSQL DB from my plugin?

2 answers

1 accepted

0 votes
Accepted answer

Hi, have you solve the problem? I meet the similar question, I want to add mysql-connector-java.jar but failed...


if you solve the problem, please reply me,thanks a lot.

So one way to deal with this issue is to manually load the jar you want to use at runtime. This page was helpful:

Thank you very much, you help me solve the problem which trouble me for one week. I sincerely appreciate you very much.

Try adding the jar file into 


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

687 views 5 9
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