在搭建maven項目的時候,有時候會報這樣的問題。
The type org.springframework.context.ConfigurableApplicationContext cannot be resolved. It is indirectly referenced from required .class files - The method run(Object, String...) from thae type SpringApplication refers to the missing type ConfigurableApplicationContext
原因是:maven緩存被損壞了
問題的解決方案
1、到工程所在目錄,記住是有pom.xml的文件目錄
2、Shift+鼠標右鍵,打開命令窗口。
在命令行執行以下命令:
mvn dependency:purge-local-repository
3、如果接收到生成成功消息,則意味着該錯誤已得到解決。
4、如果錯誤仍然存在,刪除你的 (~/.m2/repository/org/springframework) 文件夾然后執行命令
mvn package
問題解決