Java Spring:如何从jar类路径加载@ContextConfiguration?我得到FileNotFoundException
我有一个名为Java Spring:如何从jar类路径加载@ContextConfiguration?我得到FileNotFoundException,java,spring,Java,Spring,我有一个名为X的项目,它的wireup.xml布局如下: X/ Module/ src/ main/ resources/ com.here/ wireup.xml 我在项目Y中导入项目X的模块 <dependency> <groupId>com.org.X<
X
的项目,它的wireup.xml
布局如下:
X/
Module/
src/
main/
resources/
com.here/
wireup.xml
我在项目Y
中导入项目X的模块
<dependency>
<groupId>com.org.X</groupId>
<artifactId>Module</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
但是我在运行测试时出错了
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
我怎样才能解决这个问题?我怎么知道正确的路径呢?应该是@ContextConfiguration(locations={“classpath:com/here/wireup.xml”)
您的资源路径是classpath:com/here/wireup.xml
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