正在回答
3回答
同学你好,可以参考如下步骤进行操作:
1,在项目上右键-->Maven--> Update Project
Update Project功能本身是用于当项目结构发生一些变化时更新项目,主要是更新.classpath文件,让Eclipse按照最新的.classpath文件的内容处理项目。
2,直接改.classpath文件
Maven Dependencies 这个library在.classpath文件中是这么标记的:
1 2 3 4 5 6 7 8 9 10 | <classpathentry kind= "con" path= "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" > <attributes> <attribute name= "maven.pomderived" value= "true" /> </attributes> </classpathentry> <classpathentry kind= "con" path= "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" > <attributes> <attribute name= "maven.pomderived" value= "true" /> </attributes> </classpathentry> |
把这段添加进去.classpath文件,放在<classpath>标签下,比如这样:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?xml version= "1.0" encoding= "UTF-8" ?> <classpath> <classpathentry kind= "src" output= "target/classes" path= "src/main/java" > <attributes> <attribute name= "optional" value= "true" /> <attribute name= "maven.pomderived" value= "true" /> </attributes> </classpathentry> <classpathentry including= "**/*.java" kind= "src" path= "src/main/resources" /> <classpathentry kind= "con" path= "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" > <attributes> <attribute name= "maven.pomderived" value= "true" /> </attributes> </classpathentry> <classpathentry kind= "con" path= "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" > <attributes> <attribute name= "maven.pomderived" value= "true" /> </attributes> </classpathentry> <classpathentry kind= "output" path= "target/classes" /> </classpath> |
如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧