eclipse中对maven项目的资源配置

今天在myeclipse里面运行正常的maven项目,导入到eclipse里面,启动时候报错:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 

是因为eclipse和myeclipse有些差异,在这里需要设置一下eclipse:
项目右键 --> properties -> Deployment Assembly -> Add -> Java Build Path Entries -> 选择Maven Dependencies -> Finish -> OK
把对应的Maven依赖包也发布到tomcat,调试时会自动把那些jar发布到指定目录下,tomcat也能找到那些jar了。

猜你喜欢

转载自luanxiyuan.iteye.com/blog/1944100