When IDEA runs 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.

Solution reference: https://blog.csdn.net/weixin_36979214/article/details/107282951 (Thank you, big guy!)

Don't execute the program in the main method, use unit tests

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

Bundle

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

change to

@Test
    public void test() throws  ClientException {
    
    

Just

Guess you like

Origin blog.csdn.net/qq_40794986/article/details/114083383