SpringBoot Junit 測試報錯

如果當你 Junit 測試的時候報這個錯,就要看過來了

java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy

Caused by: java.lang.ClassNotFoundException: org.springframework.core.annotation.MergedAnnotations$SearchStrategy

解決辦法:檢查Spring-test的版本是否跟parent依賴版本保持一致

一般情況都是因爲這個原因,版本不一致,導致不兼容。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章