Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

It is possible to use PluginEnabledEvent for catch plugin enable?

Влад Демидик August 21, 2018

I can't use plugin  when i add this class to proejct:

Component
public class PluginEnabledListener implements InitializingBean, DisposableBean {

@JiraImport
private final EventPublisher eventPublisher;

@Autowired
public PluginEnabledListener(EventPublisher eventPublisher) {
this.eventPublisher = eventPublisher;
}

@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);
}

@Override
public void afterPropertiesSet() throws Exception {
eventPublisher.register(this);
}

@EventListener
public void onPluginEnable(PluginEnabledEvent pluginEnabledEvent) {
log.error(pluginEnabledEvent.getPlugin().getKey());
}
}

Mb someone knows what is wrong.

Thanks!

1 answer

1 vote
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2018

Can you provide more details about the problems you're having? What do you mean by "I can't use the plugin"?

MyFullName
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2018

It's disabled.

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2018

Well you need to check the logs and see what happened. Probably the problem is not related to the code above.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events