Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I can't add dependencies to my Confluence plugin

Míkel Rodríguez Domínguez
Contributor
March 30, 2022

Whenever I add a dependency to connect to databases to my Confluence plugin I get this exception:

org.osgi.framework.BundleException: Unable to resolve [...]: missing requirement [...] osgi.wiring.package; (osgi.wiring.package=com.mchange.v2.c3p0) Unresolved requirements: [...] osgi.wiring.package; (osgi.wiring.package=com.mchange.v2.c3p0)]

The dependency I'm trying to add is

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.48</version>
</dependency>

 

How can I fix this?

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
April 5, 2022

Hi @Míkel Rodríguez Domínguez 

I exactly recall this problem in Jira plugins, and I know it's tough to solve. 

What I'd suggest is to add the <Import-Package> section into your <instructions> element under the pom configuration and make the relevant packages optional. Otherwise you need to add all related dependencies to your pom.xml

Here it seems that "com.mchange.v2.c3p0" package needs to be done optional but if you add this other packages might throw similar errors.

 

<Import-Package>
com.mchange.v2.c3p0;resolution:="optional",
*
</Import-Package>

 Hope it was helpful

Tuncay

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events