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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

How to use spring annotations in Confluence plugin

Hi,

I am new to plugin development for Atlassian products. Currently i am writing a plugin for Confluence. Though i know the basics of plugin development i have facing issues while trying to use spring annotation @Autowired in my plugin code. 

In order to resolve the compile error i added the spring-context dependency in my plugin's pom.xml. But after adding that my plugin did not deploy and failed when i ran atlas-run command. I have a REST resource class in my plugin lets say it is A. This class depends on a service class B and invokes it's methods. My plugin was working fine till i was creating an object of B manually by using new keyword in class A.

e.g. - B obj = new B() works just fine, but as soon as i tried to use @Autowired B b; my plugin started complaining.

I have below 3 questions.

1 - Cant I use spring annotations such as @Component , @Autowired, @Service etc in Atlassian plugin code?

2 - Does the Atlassian plugin dependencies bring in spring libraries by default? I mean does the atlassian-spring-scanner-annotation & atlassian-spring-scanner-runtime dependencies bring in spring libraries as well?

3 - What configuration need to do for using spring in Atlassian plugins?

 

Thanks

Ayaskant

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

409 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you