现在我们可以把原来项目的包引用改成使用maven的依赖库了,做法很简单,修改你项目的.classpath配置文件,把原来的包引用全部删除,并加入maven的依赖引用,我的.classpath文件最后是这样的,发出来为大家做参考
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
<classpathentry kind="lib" path="target/classes"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>