SpringBoot集成MybatisPlus,啓動的時候老是報以下錯誤:html
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
at java.lang.reflect.Method.getDefaultValue(Method.java:612) ~[na:1.8.0_161]
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132) ~[na:1.8.0_161]
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85) ~[na:1.8.0_161]
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266) ~[na:1.8.0_161]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_161]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_161]
at java.lang.Class.createAnnotationData(Class.java:3521) ~[na:1.8.0_161]
at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_161]java
at java.lang.Class.getAnnotations(Class.java:3446) ~[na:1.8.0_161]spring
從網上查資料一直覺得是本身的MyBatis和SpingBoot的版本不對,後來才發現,原來是須要一個mybatis-spring-boot-starter的包,在pom文件加上以後,完美解決。mybatis