IDEA maven spring-boot-starter-thymeleaf 包引入失敗原因總結

Tips: 究極解決方案放在了最後面

在 maven 的 pom。xml 檔案中引入了 spring-boot-starter-thymeleaf 包,但在 IDEA maven 管理介面中該包顯示紅色波浪線,啟動專案後網頁也沒有生成,說明包沒有匯入成功,這時可以透過以下方法檢查修復:

切換映象源

在 maven 全域性配置 setting。xml 中加入國內映象源(一般在 C:\Users\使用者名稱\。m2\wrapper\dists\apache-maven-3。6。3-bin\1iopthnavndlasol9gbrbg6bf2\apache-maven-3。6。3\conf\settings。xml 目錄)

<!—— 加入到 mirrors 節點下面 ——> nexus-aliyun * Nexus aliyun http://maven。aliyun。com/nexus/content/groups/public

嘗試切換 spring-boot-starter-thymeleaf 版本

在專案根目錄下面的 pom。xml 檔案中加入版本號,下載不同版本的包進行嘗試

IDEA maven spring-boot-starter-thymeleaf 包引入失敗原因總結

檢查 IDEA maven 路徑配置 (重要)

預設情況下,IDEA 調取的是專案內的 maven, 開啟如下設定介面,將 maven 路徑改為全域性的, 我這邊遇到的問題也是因為這個原因造成的,修改後就合適了

IDEA maven spring-boot-starter-thymeleaf 包引入失敗原因總結

如果還不能解決問題,請訪問此連結獲取更多支援 ==

https://www。baidu。com/s?ie=UTF-8&wd=idea%20maven%20spring-boot-starter-thymeleaf%E5%BC%95%E5%85%A5%E5%A4%B1%E8%B4%A5

IDEA maven spring-boot-starter-thymeleaf 包引入失敗原因總結