IDEA运行test出现 Failed to execute goal org.codehaus.mojo:exec-maven-plugin:16.0.0:exec (default-cli) on

IDEA运行test出现
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project service_vod: Command execution failed.

解决方法参考:https://blog.csdn.net/weixin_36979214/article/details/107282951(感谢大佬!)

不要用main方法执行程序,而使用单元测试

因为、创建的maven项目,而maven项目执行main函数的时候需要两个插件
maven-compiler-plugin:用来编译Java文件,指定JDK版本等
exec-maven-plugin:用来执行class文件,其中插件配置中需指明执行类的路径。

public static void main(String[] args) throws ClientException {
    
    

改成

@Test
    public void test() throws  ClientException {
    
    

即可

猜你喜欢

转载自blog.csdn.net/qq_40794986/article/details/114083383