我有一个名为X
项目,该项目具有wireup.xml
奠定如下:Spring:如何从jar classpath加载@ContextConfiguration?我得到FileNotFoundException异常
X/
Module/
src/
main/
resources/
com.here/
wireup.xml
我进口的project X
Module
在project Y
作为
<dependency>
<groupId>com.org.X</groupId>
<artifactId>Module</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
现在,在测试中,我想豆是在wireup.xml
,所以我做了以下操作:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:com/org/X/Module/src/main/resources/com/here/wireup.xml"})
public class MongoSaverTest extends Case {
@Autowired
private SomeBeanInWireup variable;
}
但我得到上运行的测试说
Caused by: java.io.FileNotFoundException: class path resource [com/org/X/Module/src/main/resources/com/here/wireup.xml] cannot be opened because it does not exist
如何解决这个问题?我如何知道正确的路径?