如圖出現如下錯誤:
解決方法如下:
1、(未測試)在pom.xml添加如下配置:
<build> <defaultGoal>compile</defaultGoal> </build>
2、直接在運行的命令行上加入:
//執行 mvn clean compile test //打包 mvn clean compile test package
錯誤分析:
其實使用命令行時就已經指定了phase,而使用m2eclipse的【Run As】-【Maven build】時並未為其指定goal或phase,所以才報這個錯誤。但是一般這個是老版本才會出現,新版的eclipse已經沒有這個問題,在運行時可以添加參數運行,效果和命令行保持一致。