mvn编译java project: Failed to execute goal org.codehaus.mojo:exec-maven-plugin

使用mvn编译一个java project: mvn clean compile exec:java
结果出现如下错误:

[INFO]
[INFO] — exec-maven-plugin:1.5.0:java (default-cli) @ snmpclient —
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.477 s
[INFO] Finished at: 2018-11-11T10:31:08+08:00
[INFO] Final Memory: 23M/125M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project snmpclient: The parameters ‘mainClass’ for goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java are missing or invalid -> [Help 1]

用百度找到一条相关的结果:https://www.aliyun.com/jiaocheng/799238.html, 解决了问题,在pom文件添加如下解决:


            
               ......
                    
                            org.codehaus.mojo
                            exec-maven-plugin
                            1.2.1
                            
                                    
                                            
                                                    java
                                            
                                    
                            
                            
                                    pl.stasiak.pytel.SnmpClientApplication
                            
                    
            
    

你可能感兴趣的:(linux)