Hello,
I have Bamboo task. Everything works fine untill I want to inject service or manager.
I want to inject PlanExecutionManager so I write
public class MyFirstTask implements TaskType {
private final PlanExecutionManager execution_manager
@Inject /** or Autowire */
public MyFirstTask(@ComponentImport PlanExecutionManager manager) {
execution_manager = manager;
}
@Override
public TaskResult execute(final TaskContext context) {... }
}
But when I run the Task, the following errir is printed to the build log
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bimproject.bamboo.task.MyFirstTask': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.bamboo.plan.PlanExecutionManager]: : No qualifying bean of type [com.atlassian.bamboo.plan.PlanExecutionManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bamboo.plan.PlanExecutionManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
How Can I Inject PlanExecutionManager to the task?
Thanks for any advice
John