搭建springboot运行报错:java.lang.annotation.AnnotationFormatError
最近刚搭建了一个springboot的demo,启动报错:
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
具体如图:
原因是缺少一个spring.mybatis的依赖:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
在pom.xml导入依赖后成功启动: