package net.jira.plugins.CustomerFeedbackSurvey.osgi;
import javax.inject.Named;
import com.atlassian.activeobjects.external.ActiveObjects;
import com.atlassian.jira.project.Project;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.jira.util.I18nHelper;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;
import com.atlassian.sal.api.message.I18nResolver;
/**
* This class is used to replace <component-import /> declarations in the atlassian-plugin.xml.
* This class will be scanned by the atlassian spring scanner at compile time.
* There is no situations where you ever need to create this class, it's here purely so that all the component-imports
* are in the one place and not scattered throughout the code.
*/
@SuppressWarnings("UnusedDeclaration")
@Scanned
public class GeneralOsgiImports
{
/******************************
// JIRA
******************************/
@ComponentImport com.atlassian.jira.issue.IssueManager issueManager;
@ComponentImport com.atlassian.jira.security.PermissionManager permissionManager;
@ComponentImport com.atlassian.jira.user.util.UserManager userManager;
@ComponentImport I18nHelper i18nHelper;
@ComponentImport I18nResolver i18nResolver;
@ComponentImport JiraAuthenticationContext authenticationContext;
@ComponentImport ActiveObjects ao;
private GeneralOsgiImports()
{
throw new Error("This class should not be instantiated");
}
}
Hi @arunkumarmsks, it looks like you’re following along with this tutorial? Is that correct? Just trying to understand the context of the question you’re asking.
If you are following the tutorial @rwhitbeck mentioned - that class is basically a hack (sorry I’ll use that word to describe it) to recreate atlassian-plugin.xml’s into a single location.
One of the problems with atlassian-spring-scanner is that if an import is annotated with @ComponentImport in one class(class A) but not in another(class B) - it still gets imported (which it should be) into both class A and B. But when you then remove class A - the import isn’t done anymore and class B breaks. This looks like to be a workaround of that by having a single trusted record.