Does the Bamboo ProcessService bean not exist?

Following https://developer.atlassian.com/bamboodev/bamboo-tasks-api/executing-external-processes-using-processservice I would like to invoke some command using the ProcessService bean. Injection, as described in the link, does not work. I checked the source of several other plugins in Bitbucket, but each one uses the concept as described in the link.

My class:

import com.atlassian.bamboo.process.ProcessService;

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

However, Bamboo does not find the ProcessService bean and does not work with the following:

(org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean named "bamboo.tasks.CheckTask": unsatisfactory dependency expressed through constructor argument with index 0 of type [com.atlassian.bamboo.process.ProcessService] :: no qualification bean of type [com.atlassian.bamboo.process.ProcessService] found for dependency: at least 1 bean is expected that qualifies as a self-timer candidate for this dependency Dependency Annotations: {}; nested exception org.springframework.beans.factory. NoSuchBeanDefinitionException: No qualification bean of type [com.atlassian.bamboo.process.ProcessService] found for the dependency: given at least 1 bean that qualifies as an autwire candidate for this dependency. Dependency Annotations: {})

- ? : 5.13.0 AMPS: 6.2.6

+4
2

, . , .

, : https://answers.atlassian.com/questions/33141765/testcollationservice-not-injected-into-tasktype-constructor-on-sdk-bamboo

import com.atlassian.bamboo.process.ProcessService;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;

@Scanned
public class CheckTask implements TaskType {

    @ComponentImport
    private final ProcessService processService;

    public CheckTask(@NotNull final ProcessService processService) {
        this.processService = processService;
    }

, atlas-create-bamboo.

+2

atlassian-plugin.xml

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

+1

Source: https://habr.com/ru/post/1651377/


All Articles