Springboot 启动报错 no main manifest attribute, in xxx.jar

Springboot 启动报错 no main manifest attribute, in xxx.jar

先说结论,引起这个问题就是pom文件不对
很多博客的结论都是添加如下配置

    
        org.springframework.boot
        spring-boot-starter-parent
        2.7.8
         
       
 
	
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    
   

首先,这个配置没问题,我的问题出在idea自动生成的配置是这样的


                org.springframework.boot
                spring-boot-maven-plugin
                ${spring-boot.version}
                
                    com.shuzhi.SpringbootDemo1Application
                    true  
                    JAR
                
                
                    
                        repackage
                        
                            repackage
                        
                    
                
            

加上这个skip=true之后,打包就不会把springboot的依赖打进去了,自然也就识别不了启动类了。
ok,搞定

你可能感兴趣的:(spring,boot,jar,后端)