Eclipse里面maven项目在没有或移除Maven Dependencies后如何在添加进去

Import project,然后Convert to Maven project,发现很多红叉叉,除了source的路径不对,还有Maven Dependencies 也丢了,没有找到直接在Eclipse里面直接添加的地方,如果有大神知道一定一定给我留个言Eclipse里面maven项目在没有或移除Maven Dependencies后如何在添加进去

Eclipse里面maven项目在没有或移除Maven Dependencies后如何在添加进去


在网上找到一个解决方法是直接修改.ClassPath文件,就在你的代码路径下面,在里面添加一段配置,然后重启Eclipse即可


  1. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">  
  2.     <attributes>  
  3.         <attribute name="maven.pomderived" value="true"/>  
  4.         <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>  
  5.     </attributes>  
  6. </classpathentry>