Define spring component in spesific scope

code-in July 4, 2018

How to define a spring bean as jira spring component module in atlassian-plugins.xml file

For example, how can i convert this spring bean in spring-beans.xml to jira component

<bean id="testSingleton" class="org.test.Test" scope="singleton"/> 

1 answer

0 votes
Alexey Matveev
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.
July 4, 2018

Hello,

Try to use the scope annotation:

@Scope("singleton")

If it does not work, then you can read my artilcle here:

https://community.atlassian.com/t5/Jira-articles/Spring-Java-based-configuration-and-AOP-in-Jira-plugins/ba-p/762265

code-in July 4, 2018

Thank you for answer. Your implementation is annotatiton based, but i need. xml based implementation in atlassian-plugin.xml

Alexey Matveev
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.
July 4, 2018

No, you can not set a scope in atlassian-plugin.xml. You should set it via annotation or in the main/resources/META-INF/spring/plugin-context.xml

code-in July 6, 2018

Thank you for reply, i'll try it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events