問題描述:打開Eclipse進入java EE視圖下,發現原有的Maven Dependencies目錄不存在,顯示的是org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER;
解決方法:進入工程目錄下的.settings文件夾,查看org.eclipse.wst.common.component文件將source-path的值改正確:<wb-resoure source-path="/src/main/webapp">,重啟Eclipse生效;
其他解決方案:在網上查了各種解決途徑,不過在自己項目中並沒有生效,但還是羅列一下希望對大家有用:
方法一: 刪除工程目錄中的.setting文件夾和.project文件,重啟Eclipse;
方法二:修改.classpath文件;
<classpathentry kind="con" exported="true" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
方法三:對着工程反鍵 --> 屬性 --> Maven --> Active Maven Profiles 填入Maven Dependencies;
Eclipse項目中系統文件介紹:https://www.cnblogs.com/shihaiming/p/5803957.html 可以關注一下
