Error when trying to create an additionalBuildConfiguration plugin

Description of the plugin

With the following definition:

    <additionalBuildConfigurationPlugin key="myKey" name="myName"
                                        class="plugins.Configurator">
        <description>desc</description>
        <resource type="freemarker" name="edit" location="additionalPlanConfiguration/edit.ftl"/>
    </additionalBuildConfigurationPlugin>

Versions:

<bamboo.version>6.3.0</bamboo.version>
        <bamboo.data.version>6.3.0</bamboo.data.version>
        <amps.version>6.3.14</amps.version>
        <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
        <atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>

And the class:

public class Configurator extends BaseConfigurablePlugin implements MiscellaneousPlanConfigurationPlugin {

  @Autowired
    public Configurator(@ComponentImport TemplateRenderer renderer) {
        this.templateRenderer = renderer;
    }
// Rest of methods

}

I still get a null templateRenderer, or “no qualifying bean” or errors telling me that the TemplateRenderer can’t be used. If i use annotations, class fails to load because i have no bean to inject. Other solutions throw NullPointerException when trying to use it later (it doesn’t get correctly injected).

I have tried everything i have seen, and still can’t make it work.

Thinkgs that i have tried

I have tried to:

Import this:

com.atlassian.bamboo.template.*;version:="0";resolution:="optional",

In in the project POM.

Use different Inject, ComponentImport, Autowired and other annotations, to no effect.
Attempt to configure it following other similar plugins… still no success.

Atempted to inject an implementation, instead of the TemplateRenderer interface, still not working.

I have ran out of ideas, this is a cry for help!!!

Thank you very much!

PS: If you need additional information please make me know.

Author here, found a solution!!!

In my class, define the annotation com.atlassian.plugin.spring.scanner.annotation.component.Scanned.

@Scanned
public class Configuration extends BaseConfigurablePlugin implements MiscellaneousPlanConfigurationPlugin {

@BambooImport
    protected TemplateRenderer templateRenderer;

// Rest of class
}

And it works like a charm!