idea报错:Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on

发布时间 2023-10-07 15:44:41作者: 信铁寒胜

idea版本:​​2020.3​​
idea 报错:在查阅了资料以后发现是​​IDEA2020​​的兼容问题

 

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project sms: Command execution failed.

解决方法:

1、测试不要用​​main​​方法测试,使用​​junit​​测试

2、更换版本至​​IDEA2017​​

3、File ->Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner

取消将IDE生成/运行操作委托给Maven

 

XTHS实测:不用main方法,用junit测试就可以了。