1. 程式人生 > >eclipse創建maven項目時報錯解決辦法

eclipse創建maven項目時報錯解決辦法

版本 erro mave type version red cti star error

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即可

eclipse創建maven項目時報錯解決辦法