eclipse创建maven项目时报错解决办法

1、Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories.

办法:下载maven-archetype-quickstart-1.1.jar放入安装maven的lib文件夹下,在此处启动dos窗口输入命令:mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=d:\maven-archetype-quickstart-1.1.jar     下划线部分是你jar包放在的位置

2、Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 5 6

办法:出现这个问题的主要原因是项目路径存在中文导致,因此只要将目录换成没有中文字符的就可以了.

3、java.lang.NoClassDefFoundError: org/junit/Assert

办法:pom.xml文件中的junit的版本改为4.1即可

猜你喜欢

转载自www.cnblogs.com/qinyios/p/10292679.html