Hi,
I am trying to create a report accessing information of sprints. I am adding the greenhopper plugin in the pom.xml file:
<dependency>
<groupId>com.atlassian.jira.plugins</groupId>
<artifactId>jira-greenhopper-plugin</artifactId>
<version>${jira.greenhoper.version}</version>
<scope>provided</scope>
</dependency>
However when I try to use some classes in the constructor class:
private final RapidViewService rapidViewService;
private final VelocityChartModelFactory velocityChartModelFactory;
public BugPieReport(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties,
ProjectManager projectManager, SearchRequestService searchRequestService, ChartUtils chartUtils,
ChartFactory chartFactory,RapidViewService rapidViewService, VelocityChartModelFactory velocityChartModelFactory) {
super(authenticationContext, applicationProperties, projectManager, searchRequestService, chartUtils);
this.chartFactory = chartFactory;
this.jiraAuthenticationContext = authenticationContext;
this.rapidViewService = rapidViewService;
this.velocityChartModelFactory = velocityChartModelFactory;
}
I get the following error:
1 plugin failed to load during JIRA startup.
'com.atlassian.plugins.tutorial.jira.jira-report-plugin' - 'jira-report-plugin' failed to load.
Unexpected exception parsing XML document from URL [bundle://153.0:0/META-INF/spring/plugin-context.xml]; nested exception is java.lang.NullPointerException
null
It was loaded from E:\QSCPC880_EHM_Backup\Reports\Plugins\Version2\jira-report-plugin\target\jira\home\plugins\installed-plugins\jira-report-plugin-2.10-SNAPSHOT.jar
I then tried, adding the @ComponentImport in greenhopper classes:
public BugPieReport(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties,
ProjectManager projectManager, SearchRequestService searchRequestService, ChartUtils chartUtils,
ChartFactory chartFactory,@ComponentImport RapidViewService rapidViewService, @ComponentImport VelocityChartModelFactory velocityChartModelFactory) {
super(authenticationContext, applicationProperties, projectManager, searchRequestService, chartUtils);
this.chartFactory = chartFactory;
this.jiraAuthenticationContext = authenticationContext;
this.rapidViewService = rapidViewService;
this.velocityChartModelFactory = velocityChartModelFactory;
}
But get this error:
[c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'org.springframework.beans.factory.UnsatisfiedDependencyException - Error creating bean with name 'com.atlassian.plugins.tutorial.jira.reports.BugPieReport': Unsatisfied dependency expressed through constructor argument with index 6 of type [com.atlassian.greenhopper.service.rapid.view.RapidViewService]: No qualifying bean of type [com.atlassian.greenhopper.service.rapid.view.RapidViewService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.greenhopper.service.rapid.view.RapidViewService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}'.
What am I missing?, what is the correct way to use classes of the GreenHopper Plugin in a custom plugin?. Thanks.
Regards,
Edgar