I looking for quick way to find bean definition by their @Autowired dependency in java code. Suppose I have:
@Autowired
private JdbcTemplate template;
I want IDEA tell me in which xml file is the definition of template
bean. How to do that?
If you have the spring plugin installed and active you should see some icons on the left gutter which help you to identify the place where the bean has been defined, either xml or annotation. If you have multiple spring profiles you may have to chose the active one.
First install spring plugin by Ctrl+Alt+S
under IDE Settings, select Plugins.
In the right-hand part of the dialog, on the Plugins page, type spring in the search box.
If the check box to the left of Spring Support is not selected, select it. If you are going to use particular Spring frameworks (Spring Security, Spring Integration, etc.), make sure that the check boxes next to their names are also selected.
Then the icons on the left(near the code line-number) helps to identify the bean definition
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With