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?
Community moderators have prevented the ability to post new answers.
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).
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure but guess it's caused by OSGI nature of JRA type 2 plugins.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.