Autocomplete Spring ClassPathXmlApplicationContext

I have spring.xml at the root of my resource directory (marked as a test source).





I then have this in my test:

context = new ClassPathXmlApplicationContext("spring.xml");





However, I can't Ctrl-Click on spring.xml and jump to the file.


I can if I do the following:

  
context = new ClassPathXmlApplicationContext("file:spring.xml");
 

However, my spring.xml will be deployed in a jar so that is no good for me.
Is this a bug?
There is a fixed issue that looks similar http://youtrack.jetbrains.net/issue/IDEA-57982

2 comments
Comment actions Permalink

Can you try "classpath:/spring.xml"?

0
Comment actions Permalink

Not quite!
I have noticed a couple of interesting things.

Both of the following work in the test, but only the second resolves within IDEA.

context = new ClassPathXmlApplicationContext("spring.xml");
context = new ClassPathXmlApplicationContext("/spring.xml");


Both the following fail in the test yet both resolve in IDEA!

context = new ClassPathXmlApplicationContext("classpath:spring.xml");
context = new ClassPathXmlApplicationContext("classpath:/spring.xml")

0

Please sign in to leave a comment.