Keep in mind that this example uses Spring Scanner, which has some host product compatibility constraints. Spring scanner 2 is only compatible with Bamboo 5.14+. For older versions, use Spring Scanner 1. See also Bitbucket and Bitbucket
Thanks, I used the annotates and got something working. I found that calling certain methods I would get a weird error like:
[INFO] [talledLocalContainer] 2018-09-19 14:46:14,561 INFO [17-BAM::Default Agent::Agent:pool-32-thread-1] [DefaultErrorHandler] Recording an error: Fail Handling Plugin custom build post complete action failed to run : TEST-GM-JOB1 : failed to lazily initialize a collection of role: com.atlassian.bamboo.resultsummary.AbstractResultsSummary.labellings, could not initialize proxy - no Session
For Bamboo there are essentially 2 modes of operations - on the agent or on the server. (Local agents are technically on the server but I would highly recommend ignoring that since if you introduce remote agents into the mix - your code will break).
The reason I bring this up is that the server code can inject pretty much anything it wants. Things running on the agents - don’t have access to the database, user authentication etc. They get the build info and the directory. They can generate data and send it back to the server to be processed. In your case BuildResultsSummaryManager is dependent on the database thus not available on the agent.
That said - you can break your code up and do things before the build gets sent to the remote agent (take a look at Custom Build Definition Transformer module ). You can then use the postBuildProcesserServer to interpret on the server.
There used to be a pretty graph on developer.atlassian.com that explained the build cycle for Bamboo, but it seems to have been removed (there doesn’t seem to be much of documentation for Bamboo nowadays). I swear there was a more straight forward module to handle intra-agent-server communications as well.