MyEclipse启动Maven Web项目Tomcat下没有lib包,报ContextLoaderListener错误

在使用MyEclipse等开发工具,做Web开发时,启动Maven Web项目时报如下错:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
此问题是由于Tomcat启动Maven Web项目时没有加载lib包。

解决方法:
右键项目Properties->MyEclipse->Deployment Assembly 可以看到里面少了lib包的依赖
MyEclipse启动Maven Web项目Tomcat下没有lib包,报ContextLoaderListener错误
在此我们可以添加下

点击Add 选择Java Build Path Entries
MyEclipse启动Maven Web项目Tomcat下没有lib包,报ContextLoaderListener错误
点击Next选择Maven Dependencies

MyEclipse启动Maven Web项目Tomcat下没有lib包,报ContextLoaderListener错误
点击Finish,然后就可以看到Deployment Assembly里面多了一个lib包的
MyEclipse启动Maven Web项目Tomcat下没有lib包,报ContextLoaderListener错误
点击Apply->OK,然后重新加载项目并启动就可以了。