Bamboo ProcessService bean不存在?

时间:2016-08-16 07:44:24

标签: java spring dependency-injection bamboo atlassian-plugin-sdk

关注https://developer.atlassian.com/bamboodev/bamboo-tasks-api/executing-external-processes-using-processservice我想使用ProcessService bean调用一些命令。链接中描述的注入不起作用。 我检查了Bitbucket上其他几个插件的来源,但每个插件都使用链接中描述的概念。

我的课程:

import com.atlassian.bamboo.process.ProcessService;

public class CheckTask implements TaskType {
    private final ProcessService processService;
    public CheckTask(@NotNull final ProcessService processService) {
        this.processService = processService;
    }

然而,Bamboo找不到ProcessService bean并且失​​败并显示以下内容:

  

(org.springframework.beans.factory.UnsatisfiedDependencyException:   创建名称为' bamboo.tasks.CheckTask':不满意的bean时出错   依赖性通过构造函数参数表示,索引为0   [com.atlassian.bamboo.process.ProcessService] ::没有合格的bean   找到的类型为[com.atlassian.bamboo.process.ProcessService]   依赖:预计至少有1个bean有资格成为autowire   这种依赖的候选人。依赖注释:{};嵌套   例外是   org.springframework.beans.factory.NoSuchBeanDefinitionException:没有   [com.atlassian.bamboo.process.ProcessService]类型的限定bean   找到依赖:预计至少有1个bean符合条件   autowire候选人这种依赖。依赖注释:{})

我错过了什么吗? Bamboo版本:5.13.0 AMPS版本:6.2.6

1 个答案:

答案 0 :(得分:1)

尝试添加 atlassian-plugin.xml 下一行

<component-import key="processService" 
        interface="com.atlassian.bamboo.process.ProcessService"/>

那应该对你有帮助