打开pom.xml 在build标签中 增加 <defaultGoal>compile</defaultGoal> 如下: <build><defaultGoal>compile</defaultGoal> </build> 相关文章: mvn打包报错You must specify a valid lifecycle phase or a goal in the format 2021-05-15 Unknown lifecycle phase "mvn" You must specify a valid lifecycle phase or a goal in the format 2021-08-24 Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal in the format 2021-10-24 Eclipse集成Maven打包时报错:[ERROR] Unknown lifecycle phase "mvn". 2022-12-23 Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle 2022-12-23 maven lifecycle, plugin, phase以及goal 2021-12-04 运行maven build报错No goals have been specified for this build. 2022-12-23 No goals have been specified for this build. 2021-12-27