Trying to execute SQL in a confluence plugin to a jiraDS datasource define in the confluence configuration file. Plugin has dependencies for jira-api and jira-core defined with 'provided' as value for <scope>provided</scope>. The subsequent atlas-compile and atlas-package build and packaging has no errors. The resulting plugin jar file was too large at 76Mbytes and the limit on the server was defaulted to 67Mbytes. I proceeded to copy just the class files that i used my code and reduced the file size to about 1Mbyte, which uploaded as an add on plugin with no errors. When going to a page that has the plugin it then throws this error:
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en_US
Code used in plugin to attempt to getConnection():
try {
DefaultOfBizConnectionFactory factory = DefaultOfBizConnectionFactory.getInstance();
Connection connection = factory.getConnection();
// do something with connection
} catch (SQLException sqle) {
String message = sqle.getMessage();
}
Is there another way to reduce the plugin jar file size without piece mealing the classes folder with required classes? Is there a better way to get a connection object for executing SQL in a plugin without doing straight jdbc? I'd like to reuse the defined 'jiraDS' datasource in Confluence's configuration file.