Maven解决打包Spring Boot项目报错:repackage failed: Unable to find main class、程序包xxx不存在

一、Maven打包Spring Boot项目报错(repackage failed: Unable to find main class),排除寻找Main方法,一般用于被依赖的公用常量模块,解决方法如下:

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    none     
                    execute    
                
                
                    
                        
                            repackage
                        
                    
                
            
        
    

注意:
1、此打包插件 spring-boot-maven-plugin 有点坑,此插件打的包可以正常被依赖运行,但是依赖方打包的时候却找不到被依赖方的程序包或类
2、特别注意,当maven打包出现上述问题时,一定要把此项 execute 配置在被依赖方的打包插件依赖中

二、其他服务模块可以正常配置打包插件如下:


  
    
      org.springframework.boot
      spring-boot-maven-plugin
    
  

你可能感兴趣的:(Maven专栏,maven,spring,boot)