常見錯誤:
常見錯誤一:These projects must be migrated to correctly function in this version of MyEclipse
需要修改編碼方式
myeclipse編碼為GBK,項目編碼為UTF-8,將myeclipse的默認編碼方式改為UTF-8
常見錯誤二:org.apache.maven.archiver.MavenArchiver.getManifest
“Help”--“Install”
注:
Name:MavenArchiver
Location:https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
或者:http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
注:復選框"Contact all update sites during install to find required software"應取消,速度會稍快一點。
常見錯誤三:Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin
Myeclipse中:“Window” -- “Preferences” -- “Maven” -- “Lifecycle Mapping”
查看Change mapping file location一欄的地址,一般都是xxxxx/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml,然而一般org.eclipse.m2e.core目錄下沒有lifecycle-mapping-metadata.xml文件
查看Change mapping file location一欄的地址,一般都是xxxxx/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml,然而一般org.eclipse.m2e.core目錄下沒有lifecycle-mapping-metadata.xml文件

我們需要到Eclipse的安裝目錄下找到plugins\org.eclipse.m2e.lifecyclemapping.defaults_xxxxx.jar文件,解壓之后就會看到一個lifecycle-mapping-metadata.xml文件,打開編輯他

<pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <versionRange>[2.5,)</versionRange> <goals> <goal>testCompile</goal> <goal>compile</goal> </goals> </pluginExecutionFilter> <action> <ignore /> </action> </pluginExecution>
保存之后將其復制到上面說的xxxxx/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml目錄。
可以把Preferences -> Maven中的Update Maven projects on startup選項勾上,然后重啟Eclipse即可。
可以把Preferences -> Maven中的Update Maven projects on startup選項勾上,然后重啟Eclipse即可。
常見錯誤四:maven install 沒有反應
eclipse的maven項目中,在run as 執行maven命令的時候發現毫無反應,console也不打印信息,原因是因為沒有傳參數,解決辦法如下:


Default VM Arguments 中 -Dmaven.multiModuleProjectDirectory=$M2_HOME
這里的$M2_HOME指的是你在配置的maven的環境變量,這個環境變量的值是maven在你電腦里的安裝路徑