0
点赞
收藏
分享

微信扫一扫

Eclipse工程不能加载maven的repository的jar包问题



eclipse将普通的工程转成maven工程后,有时候会加载不到maven仓库的jar包,build起来没有问题,但造成开发上很大的不便,要解决也很简单,打开“Navigator”视图,在菜单选择Window -> Show View - > Navigator,找到工程目录下的.classpath文件,在<classpath></classpath>之间加一句:

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>


或者


<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 Build Path中会多了一项"Maven Dependencies"


举报

相关推荐

0 条评论