maven项目没有或移除Maven Dependencies后如何在添加进去
今天碰到了这样的一个问题:svn下载maven工程时,该工程没有Maven Dependencies。
就是红线的东西不存在
然后找了一些办法都无法解决。最终发现在该工程的.ClassPath文件中添加这段代码即可
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
- </attributes>
- </classpathentry>
然而 启动时还是报错,扔出了 java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext 的错误
需要在工程-> properties -> deloyment assembly 中添加Maven Dependencies 使之在编译的时候把jar包编译到class中