eclipse libraries 不存在maven的依赖包时,照着下面一步步来
1.项目右键-》Build Path -》 Java Build Path -》Libraries -》Add Library -》Maven Managed Dependences-》点击Next -》点击‘Maven Project settings’ , 在‘Active Maven Profiles (comma separated)’中添加“Maven Dependencies”确认即可。
2. .classpath 里面添加如下,存在不添加
1
2
3
4
5
6
|
<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>
|
3.重启eclipse,查看上述两个步骤,会看到maven dependencies出现了,报的错消失了
本文转自布拉君君 51CTO博客,原文链接:http://blog.51cto.com/5148737/1859914,如需转载请自行联系原作者