SpringBlade项目使用Docker打包部署时,打包到blade-common 模块报错。

Blade 未结 1 1021
zhengfuyou
zhengfuyou 2020-07-30 17:06

[INFO] Reactor Summary for SpringBlade 2.7.1:

[INFO]

[INFO] SpringBlade ........................................ SUCCESS [  8.964 s]

[INFO] blade-common ....................................... FAILURE [  3.070 s]

[INFO] blade-service-api .................................. SKIPPED

[INFO] blade-user-api ..................................... SKIPPED

[INFO] blade-auth ......................................... SKIPPED

[INFO] blade-gateway ...................................... SKIPPED

[INFO] blade-ops .......................................... SKIPPED

[INFO] blade-admin ........................................ SKIPPED

[INFO] blade-dict-api ..................................... SKIPPED

[INFO] blade-develop ...................................... SKIPPED

[INFO] blade-resource ..................................... SKIPPED

[INFO] blade-seata-order .................................. SKIPPED

[INFO] blade-seata-storage ................................ SKIPPED

[INFO] blade-desk-api ..................................... SKIPPED

[INFO] blade-service ...................................... SKIPPED

[INFO] blade-desk ......................................... SKIPPED

[INFO] blade-log .......................................... SKIPPED

[INFO] blade-system-api ................................... SKIPPED

[INFO] blade-system ....................................... SKIPPED

[INFO] blade-user ......................................... SKIPPED

[INFO] blade-demo-api ..................................... SKIPPED

[INFO] blade-demo ......................................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  19.808 s

[INFO] Finished at: 2020-07-30T16:57:31+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:repackage (default) on project blade-common: Execution default of goal org.springframewor

k.boot:spring-boot-maven-plugin:2.2.7.RELEASE:repackage failed: Unable to find main class -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn -rf :blade-common


1条回答
  •  smallchill
    smallchill (楼主)
    2020-07-30 17:32

    主要错误是这个:Unable to find main class

    解决办法有两种:

    1、在blade-common的pom内加上如下配置

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    true
                    ${project.name}
                
            
            
                com.spotify
                docker-maven-plugin
                ${docker.plugin.version}
                
                    true
                
            
        
    

    2、在blade-common内随意一个类增加一个空的

    public static void main(String[] args) {
       
    }


    0 讨论(0)
提交回复