說明
首先說明一下,這可能是jar沖突原因,導致該原因可能是因為jar版本不一樣
啟動類啟動報錯:
Exception in thread "main" java.lang.AbstractMethodError: org.springframework.boot.context.config.ConfigFileApplicationListener.supportsSourceType(Ljava/lang/Class;)Z
測試方法運行報錯
org.springframework.core.annotation.AnnotationConfigurationException: Attribute 'proxyBeanMethods' in annotation [org.springframework.boot.autoconfigure.SpringBootApplication] is declared as an @AliasFor nonexistent attribute 'proxyBeanMethods' in annotation [org.springframework.context.annotation.Configuration].
解決
具體到我這個項目,是由於springboot中的spring版本和父項目中的spring版本不一致導致,最終排除掉springboot中的spring,或者重新建一個單純的springboot項目得以解決。