我有一个新安装的eclipse版本: Version: 2020-09 (4.17.0)我正在尝试构建一个spring web应用程序并将其部署到Tomcat 7。当我执行maven-install时,我得到以下错误:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [root-context.xml] cannot be opened because it does not exist我将src/main/webapp/WEB-INF/spring中的root-context.xml添加到我的构建路径中。我不知道要不要把它搬到别的地方去。
发布于 2020-10-23 02:55:01
尝试将root-context.xml移动到src/main/resources目录,它将包含在eclipse目标文件夹中并正确运行。
如果您在测试路径中有测试添加,请在您的pom.xml上添加以下内容
<build>
....
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
....
</build>https://stackoverflow.com/questions/64488692
复制相似问题