How to use 'DynamicImport-Package' instruction

Hi, I am developing a Jira plugin. I need to load classes at run time.

this.getClass().getClassLoader().loadClass("com.atlassian.jira.bc.issue.IssueService")

For this purpose, I added ‘DynamicImport-Package’ attirbute under instructions tag of ‘maven-jira-plugin’ like this.

<DynamicImport-Package>com.atlassian.jira.bc.issue.*,</DynamicImport-Package>

I check that the instruction is in MANIFEST.MF.

DynamicImport-Package: com.atlassian.jira.bc.issue.*,

When i try to load the class from this package which is specified in ‘DynamicImport-Package’ attribute, i am getting “ClassNotFoundException”.

I don’t know what else to check for. Anyone know what could be the cause for this behavior ?
What should be the way to do it ?

Thanks

Where are you loading the class at run time? Have you tried using the ComponentAccessor?

ComponentAccessor.getIssueService()

https://docs.atlassian.com/jira/server/com/atlassian/jira/component/ComponentAccessor.html#getIssueService--

IssueService is just for an example. I need to load classes to a servlet at runtime by using a class load method.