解決IDEA springboot"spring-boot-maven-plugin"報(bào)紅問(wèn)題
項(xiàng)目環(huán)境:Idea 2020.2.3、 Maven 3.6.3 、springboot 2.1.4
本人在創(chuàng)建springboot項(xiàng)目時(shí)spring-boot-maven-plugin 及Idea右側(cè)Plugins劃紅,導(dǎo)致項(xiàng)目啟動(dòng)打包有問(wèn)題。雖然項(xiàng)目能跑,但是后續(xù)開(kāi)發(fā)中可能會(huì)出現(xiàn)不可預(yù)知的問(wèn)題。太礙眼決定把它解決掉。
可能原因:1、maven沒(méi)有刷新;2、Maven插件下載速度太慢,從國(guó)外的中央倉(cāng)庫(kù)下載;3、也有可能是本地springboot版本問(wèn)題等....
分析思路:1、到倉(cāng)庫(kù)中發(fā)現(xiàn)有這插件,然后clean install 以后reimport還是飄紅。
2、那我們找到Maven地址中的setting.xml中的mirrors標(biāo)簽添加以下內(nèi)容,maven再次下載jar包時(shí),idea中看到,從阿里云提供的地址下載,速度比中央倉(cāng)庫(kù)快
<settings xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd'> <localRepository>C:Usersxxx.m2repository</localRepository> <!--這個(gè)地方改成自己本地路徑--> <interactiveMode/> <offline/> <pluginGroups/> <mirrors><mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror><mirror> <id>repo1.maven.org</id> <name>Repo1 Maven of https://repo1.maven.org/maven2/</name> <url>https://repo1.maven.org/maven2/</url> <mirrorOf>central</mirrorOf> </mirror><!----> </mirrors> <proxies/> <profiles><profile> <id>downloadSources</id> <properties><downloadSources>true</downloadSources><downloadJavadocs>true</downloadJavadocs> </properties></profile> </profiles> <activeProfiles> <activeProfile>downloadSources</activeProfile> </activeProfiles></settings>
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
但是以上兩個(gè)方法依然沒(méi)有解決,因?yàn)轫?xiàng)目都是其它同事一直能跑起來(lái)過(guò)的,那就說(shuō)明程序肯定沒(méi)問(wèn)題。主要我之前也是跑得好好的,也就換了一下系統(tǒng),Idea版本也安裝到2020.2.3 版本而已,到此心里感覺(jué)到了崩潰的邊緣,只想說(shuō)這是為什么......
然后實(shí)在找不到問(wèn)題所在 ,最后試著改了改pom.xml文件
<version>2.2.2.RELEASE</version>
居然和版本有關(guān)系,問(wèn)題就解決了。
有的網(wǎng)友說(shuō)檢查maven倉(cāng)庫(kù)地址,將改為C:Usersxxx.m2repository,默認(rèn)地址。大家也可以試試。這種問(wèn)題可能還是本地版本不太對(duì)應(yīng)導(dǎo)致,希望能幫助到大家。
也可以能有其他的問(wèn)題,這方法不一定完全適應(yīng),僅供參考
如果大家有遇到Java-springboot的問(wèn)題都可以加QQ群進(jìn)行交流:Java技術(shù)交流群:554101646
到此這篇關(guān)于解決IDEA springboot'spring-boot-maven-plugin'報(bào)紅問(wèn)題的文章就介紹到這了,更多相關(guān)'spring-boot-maven-plugin報(bào)紅內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. HTTP協(xié)議常用的請(qǐng)求頭和響應(yīng)頭響應(yīng)詳解說(shuō)明(學(xué)習(xí))2. HTML5實(shí)戰(zhàn)與剖析之觸摸事件(touchstart、touchmove和touchend)3. XML入門(mén)的常見(jiàn)問(wèn)題(三)4. React優(yōu)雅的封裝SvgIcon組件示例5. HTML5 Canvas繪制圖形從入門(mén)到精通6. Vue如何使用ElementUI對(duì)表單元素進(jìn)行自定義校驗(yàn)及踩坑7. 不要在HTML中濫用div8. XML在語(yǔ)音合成中的應(yīng)用9. CSS清除浮動(dòng)方法匯總10. HTML DOM setInterval和clearInterval方法案例詳解
