Why is ContextConfiguration location different in idea and eclipse
Posted
by jakob
on Stack Overflow
See other posts from Stack Overflow
or by jakob
Published on 2010-05-19T07:25:33Z
Indexed on
2010/05/19
7:30 UTC
Read the original article
Hit count: 410
Hello experts. In my team we work both in Eclipse and Idea. That works pretty good, except for one minor issue that I can't figure out how to solve. When setting the ContextConfiguration location in our tests and running them inside Eclipse everything works like a charm:
@Test(groups = { "database" })
@ContextConfiguration(locations = {" file:src/main/webapp/WEB-INF/applicationContext.xml" })
But in my Idea env I get "could not find applicationContext" error. I need to set the location like this(project name is services):
@Test(groups = { "database" })
@ContextConfiguration(locations = {" file:services/src/main/webapp/WEB-INF/applicationContext.xml" })
The project structure is like this: parent.pom with two child poms: services.pom and other.pom. When running the test in the terminal from the service project like this:
mvn -Dtest=com.mytest.service.somepackage.TheTest test
there are no issues. I guess that since my project structure is parent-with-two-children the need of /service is necessary(The project is created by pointing out the parent pom). Is there a way to fix this? Could you please help me with a solution. thx
© Stack Overflow or respective owner