Springboot 打包发布报异常,报错 java.lang.NoClassDefFoundError: lombok/Data

搜了一上午,好像都不是我这个问题,只说是依赖的问题,本地正常启动没有问题,那么就在打包的时候有问题,一路整理过来,找到了

报错代码: 

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BoomInfoMapper' defined in URL [jar:file:/wwwroot/app.jar!/BOOT-INF/classes!/*/mapper/BoomInfoMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: lombok/Data

 原因

Springboot 打包发布报异常,报错 java.lang.NoClassDefFoundError: lombok/Data_第1张图片

解决办法

Springboot 打包发布报异常,报错 java.lang.NoClassDefFoundError: lombok/Data_第2张图片


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

搞了一上午,原来是这个问题,这下打包发布没问题了,正常运行

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