Maven dependency for mysql java connector not working - linked missing requirements error

Hi,

I need to connect to an external mysql database from my JIRA plugin, for which I have included the mysql-connector-java dependency in my pom.xml.
After doing and atlas-clean and package, when I install the plugin, it says

Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxxx.myplugin [192]: Unable to resolve 192.0: missing requirement [192.0] package; (package=com.mchange.v2.c3p0)

Then after including com.mchange dependency in my pom, after installing the plugin I get -

Unable to resolve 188.0: missing requirement [188.0] package; (package=com.typesafe.config)
After adding com.typesafe in my pom…it gives another missing requirement error.

Is there anything wrong with this? How do I fix these linked missing requirements errors.

Thanks.

Probably what is happening is that some classes in the MySQL driver import these packages, but they are not used at runtime – for instance, when I try to reproduce your case the missing package is com.google.protobuf, which is used by the XDev API.

You can set the OSGi resolution of packages to optional by changing:

<Import-Package>
                            ...
                            *
</Import-Package>

to

<Import-Package>
                            ...
                            *;resolution:="optional"
</Import-Package>

Please let me know if that helps.