Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

META-INF/spring plugin examples?

Jim Bethancourt
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 16, 2012

I have tried in the past to create Spring beans as documented in Advanced Configuration with Spring XML Files but have been unsuccessful.

Are there any plugins with source code and/or detailed tutorials available that use this feature that developers could look at / follow as a starting pont?

Thanks,

Jim

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Stefan Kohler
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 17, 2012

Hi Jim

I have used in my Badgr plugin to add a component scan for the Achievements in Badgr.
source code is available on https://bitbucket.org/stefankohler/stash-badgr/src/30ef0b6bd6f5/src/main/resources/META-INF/spring/plugin-context.xml

Not sure that's the way you want to add your beans, but it might get you started.

Cheers,
Stefan

Jim Bethancourt
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 17, 2012

Awesome! Thanks so much for sharing! I had only tried using XML based bean definitions before, but didn't think to try annotation based bean wiring since I'm currently on Confluence 3.5.13, which uses Spring 2.0.8

0 votes
Thomas Lohschmidt July 14, 2013

Found my error. While playing around, I set the plugin to version 1. Now, with version="2" the META-INF/spring/plugin-context.xml get's read.

Regards

Tom

0 votes
Thomas Lohschmidt July 14, 2013

Hi,

this is what I'm experiencing, too. Spring does not autowire my custom action with beans defined in META-INF/spring/plugin-context.xml. Does anybody know, how this is supposed to work?

Regards

Tom

0 votes
Réda Housni Alaoui November 15, 2012

Hi,

I am trying to create a custom field implementation in my JIRA plugin.

This custom field needs webservices provided by a Spring bean. I tried to inject the WebService Proxy instance in many way into the CustomField class with no luck.

I tried by autowiring the CustomField attribute to the spring bean.

I followed every single line of the Atlassian documentation. My beans are declared in /META-INF/spring-beans.xml

When I run a Junit test base on the same XML config, it works !

When I use the plugin inside a JIRA instance, bean is not injected in CustomField attribute then a NullPointerException is thrown.

Please help !

0 votes
Elisabeth Friedrich August 22, 2012

Hey Jim!

I'm trying to develop a Spring-Plugin for Confluence, too and while searching for examples I came over your post. I've got a view questions:

  • If you have a plugin-context.xml-File in your META-INF/spring-Folder how schould the atlassian-plugin.xml-FIle look like? I thought you can add spring-beans in a <spring>-tag in thre plugin.xml
  • How does this all work together?

Thanks for your help!!!

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events