Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Should I embed mysql driver my jira plugin?

JongBum Lee August 27, 2015

Hi

 

I make JIRA plugin program for mysql table operation. (Using tomcat.)

 

MySQL Driver located at Tomcat/lib (mysql-connector-java-5.1.35-bin)

 

image2015-8-27 22:38:15.png

 

so, my pom.xml file mysql driver scope is provided

 

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
<scope>provided</scope>
</dependency>

 

atlas-mvn package -> .jar (plugin jar except mysql driver) upload JIRA 

 

then, class not found exception (com.mysql.....) 

 

but, change scope provided -> compile 

 

then well work. (plug in jar include mysql driver)

 

I want to know why. (As far as I know tomcat lib is global referenced)
and Should I embed mysql driver my jira plugin with compile scope?

 

 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2015

JIRA plugins have a different classpath than applications on Tomcat. JIRA plugins see what Atlassian allows them to see and the Tomcat/lib directory is not in the list. Therefore you must use "compile" in order to include the MySQL classes in your plugin. Otherwise they will be missing on JIRA (ClassNotFoundException).

Sakib Choudhury March 13, 2017

Some Plugins, for example, Nfeed allows you to put the library in the tomcat lib folder and it picks it up from there. There surely is a way right?

Also database drivers should not be residing in the pom.xml, as versions might change, imho.

0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2015

Not sure but guess it's caused by OSGI nature of JRA type 2 plugins.

TAGS
AUG Leaders

Atlassian Community Events