Hi,
I am on Bamboo 6.1.1 version running locally with atlassian SDK. I would like to create an event listener. How do I proceed with this?
Added
<bambooEventListener key="jobCompleteListener"
class="com.vmware.bamboo.plugin.listener.JobCompleteListener"/>
in the atlassian-plugin.xml. That fixed the problem. Thanks for your input guys.
There're two options available:
add to atlassian-plugin.xml
<bambooEventListener key="environmentDependencyListener"
class="com.test.MyListener"/>
public class MyListener {
@EventListener
public void onChainCompleted(final ChainCompletedEvent event) {
System.out.println("chain complete ");
}
}
It's also possible that your class can register itself
private final EventPublisher eventPublisher;
@PostConstruct
private void postConstruct() {
eventPublisher.register(this);
}
@PreDestroy
private void preDestroy() {
eventPublisher.unregister(this);
}
@EventListener
public void onChainRemoved(@NotNull ChainDeletedEvent chainDeletedEvent) {
System.out.println(chainDeletedEvent.getPlanKey());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kaushik,
I hope this Developer documentation helps you to create a sample event listener. With this, you can extend a BuildEvent or a BuildResultEvent. This page has an example of a very basic notification listener.
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
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.