You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.