While watching one of my colleagues work in IntelliJ, I was jealous to note that he could Ctrl/Command+Click on the name of a spring bean, context, or resource in either a Java annotation or a Spring context file and IntelliJ would open the backing declaration or file.
I've installed the STS suite of plugins for Eclipse, but this has only given me the ability to open declarations for beans referred to in a spring context file. E.g., command+click only works in my context file for: <bean ... ref="bean-name"/>
.
Specifically, things I can't open the declaration/resource for automatically are:
- In my context file:
<import resource="classpath:config/anotherContext.xml"/>
, I cannot open the resource anotherContext.xml. The open resource dialogue helps, but doesn't tell me which one my classpath is actually giving me. - In my Java file:
@ContextConfiguration({"classpath:/config/yetAnotherContext.xml"})
, I cannot automatically open the resource of yetAnotherContext.xml. - In my Java file:
@Resource(name = "another-bean-name")
, I cannot open the bean declaration. This one is especially difficult to discover in Eclipse, I haven't figured out an easy way to discover the bean declaration short of full search.
Surely there's a way in Eclipse to automatically discover declarations or resources for spring beans and contexts as they are used in both Java annotations and context files?