- 引言
- 使用Spring Innitializer創建SpringBoot專案
- 解決方案
引言
筆者使用的IDEA版本為2020.2.4, 在使用Spring Innitializer創建SpringBoot專案后, SpringBoot專案無法被識別IDEA正常識別, 本文將來解決這個問題.
使用Spring Innitializer創建SpringBoot專案
首先通過4張圖片, 來演示下筆者是如何通過Spring Innitializer來創建SpringBoot專案的:




創建完專案后, 如下圖所示, 發現IDEA無法識別java檔案

查看project struct, 也發現無法識別此專案為SpringBoot專案

解決方案
造成這個問題的原因, 是因為默認的maven版本(3.8.6)過高導致的, 降低maven的版本到3.5.4即可
修改專案目錄/.mvn/wrapper/maven-wrapper.properties為下列內容(只改了第一行maven的版本號)
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

修改后, 重啟下IDEA, IDEA就能夠識別了

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/545089.html
標籤:Java
上一篇:錯誤提示“com.alibaba.fastjson.JSONException: exepct '[', but string, pos 4, json”解決
下一篇:面向物件進階第三天
