Hi, I’m trying to migrate my plugin to support Jira DC 10.3.x. I’m facing issue with importing PluginSettingsFactory. Is there any official article, sample code to do so. I found some fragmented statements highlighting on @ComponentImport but no proper documentation or solution.
Hi @VivekBurman1,
if you want to use the PluginSettingsFactory in all classes without using @ComponentImport all the time you can include it inside the MyPluginComponentImpl.class.
Thats what works for me.
@ExportAsService({MyPluginComponent.class})
@Named("myPluginComponent")
public class MyPluginComponentImpl implements MyPluginComponent {
@ComponentImport
private final ApplicationProperties applicationProperties;
@ComponentImport
PluginSettingsFactory pluginSettingsFactory;
@Inject
public MyPluginComponentImpl(final ApplicationProperties applicationProperties) {
this.applicationProperties = applicationProperties;
}
public String getName() {
if (null != applicationProperties) {
return "myComponent:" + applicationProperties.getDisplayName();
}
return "myComponent";
}
}
PluginSettingsFactory is part of:
± com.atlassian.jira:jira-api:jar:10.3.0:provided
| ± com.atlassian.sal:sal-api:jar:6.0.4:provided
So no further dependency include needed.
Hope that helps
Cheers,
Daniel