maven 搭建spring框架报找不到applicationContext-*.xml文件

智者不为愚者谋,勇者不为怯者死。这篇文章主要讲述maven 搭建spring框架报找不到applicationContext-*.xml文件相关的知识,希望能为你提供帮助。
问题原因:早使用maven搭建web工程时,并没有进行分布式搭建,我是把pojo、dao、service、web 四层直接放在了一个父工程中,并没有一个一个的子工程区分,而是直接打包成了一个war包
所以在搭建过程中出现了找不到spring的映射文件,web.xml文件报错,
之后我百度了一下找到了这个配置,由重新执行了一下项目,就执行成功了
在工程的pom文件中添加以下代码

< !-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --> < build> < resources> < !-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --> < resource> < directory> src/main/java< /directory> < includes> < include> **/*.properties< /include> < include> **/*.xml< /include> < /includes> < filtering> false< /filtering> < /resource> < resource> < directory> src/main/resources< /directory> < includes> < include> **/*.properties< /include> < include> **/*.xml< /include> < /includes> < filtering> false< /filtering> < /resource> < /resources> < !-- 添加tomcat插件 --> < plugins> < plugin> < groupId> org.apache.tomcat.maven< /groupId> < artifactId> tomcat7-maven-plugin< /artifactId> < configuration> < port> 8081< /port> < path> /< /path> < /configuration> < /plugin> < /plugins> < /build>

【maven 搭建spring框架报找不到applicationContext-*.xml文件】 

    推荐阅读