Is additionalBuildConfigurationPlugin module still functional with spring scanner ?

Hi,

I have been trying to migrate to the new spring scanner, all modules of my plugins worked fine just additionalBuildConfigurationPlugin keeps failing - initially templateRenderer was null, now after adding inject for a templateRenderer:

@Inject
private PlanManager planManager;
@Inject
private PluginLicenseManager licenseManager;
@Inject
private TemplateRenderer templateRenderer;

I get something new, still no progress:

java.lang.NullPointerException
[talledLocalContainer] at com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin.getEditHtml(BaseBuildConfigurationAwarePlugin.java:84)

Can someone give a hint ?

Thank you,

Julius

 

2 answers

1 accepted

In the end had to copy a piece of code from bamboo itself, getedit and getviewhtml, unfortunatelly the component-import in xml is not working (when using the scanner)  and without spring annotations templateRenderer is no longer available for those methods to work.

@Julius Hutuleacfor unknown reason some components (listeners, additionalBuildConfigurationPlugins) aren't scanned for dependencies correctly.

Workaround is to add injection of the desired bean (in this case TemplateRendeder) to a Service, which is detected correctly.

So creating this bean in your plugin

@ExportAsService({DependencyHackService.class})
public class DependencyHaskServiceImpl implements DependencyHackService {
@ComponentImport
TemplateRenderer templateRenderer;

@Inject
public DependencyHaskServiceImpl() {
}
}

makes TemplateRenderer available and e.g. additionalBuildConfigurationPlugin starts using it normally via setTemplateRenderer.

Thanks Oleg, I will try it someday. Currently I have to fallback to previous build methods, component-import xml tags. Spring scanner is causing a mess in my dependencies, especially on the remote plug-in components.

Plug-ins having mixture of components server/agent side are affected badly.

Julius

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,562 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you