解决maven jar包打包不到tomcat下

 闲暇时用eclipse自己搭架了个maven小项目,搭架完毕启动之后,项目直接起不来,说找不到监听

class:org.springframework.web.context.ContextLoaderListener

首先:怀疑是否没导入jar包,在pom.xml 中检查spring-web的jar是已经导入的,并且 在web.xml 中 只可以ctrl+左键 点入的,证明jar包确认导入

然后:怀疑服务器上没有jar包,上tomcat查看项目果然没有jar包,  本地的maven jar包未打包上tomcat

 

解决办法:

在eclipse  中  :项目右键-->properties-->Deployment Assembly 

 

重启服务:OK 一切搞定

 

在myeclipse中:项目右键-->properties-->Myeclipst-->Deployment Assembly 

选择add-->Java build path entries -->maven Dependencies

 

猜你喜欢

转载自hetaoo.iteye.com/blog/2348772
今日推荐