搜了一上午,好像都不是我这个问题,只说是依赖的问题,本地正常启动没有问题,那么就在打包的时候有问题,一路整理过来,找到了
报错代码:
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
原因
解决办法
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.project-lombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
搞了一上午,原来是这个问题,这下打包发布没问题了,正常运行