springboot项目如何使用自己的parent

1.父模块中的配置. 



    4.0.0
    
    
    
        com.carl.study
        xx-yy
        xxxx
    
    
        
        
        
        
    

    com.carl.study.springcloud
    cloud-demo-parent
    0.0.1-SNAPSHOT
    pom
    cloud-demo-parent
    Demo project for Spring Boot


    
    
        
            
            
                org.springframework.boot
                spring-boot-dependencies
                2.1.6.RELEASE
                pom
                import
            
            
            
                cn.hutool
                hutool-all
                4.6.0
            
        
    

    
        
            
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                    2.1.6.RELEASE
                    
                    
                        true
                        true
                    
                
            
        
    


 

2. 子模块中的配置, 父模块中的相应修改会导致打包后的jar包不能在直接使用java -jar运行, 会提示找不到主类(因打包的时候没有执行spring-boot-maven-plugin的repackage目标)


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

加上repackage目标后的主要日志记录变化: 

springboot项目如何使用自己的parent_第1张图片

 

修改后, 子模块中相关的配置可能引用不到, 可以先注释掉子模块中关于springboot的配置, 待其加载完成后, 重新打开. 

你可能感兴趣的:(springboot)