解決IDEA springboot"spring-boot-maven-plugin"報(bào)紅問題
項(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)打包有問題。雖然項(xiàng)目能跑,但是后續(xù)開發(fā)中可能會出現(xiàn)不可預(yù)知的問題。太礙眼決定把它解決掉。
可能原因:1、maven沒有刷新;2、Maven插件下載速度太慢,從國外的中央倉庫下載;3、也有可能是本地springboot版本問題等....
分析思路:1、到倉庫中發(fā)現(xiàn)有這插件,然后clean install 以后reimport還是飄紅。
2、那我們找到Maven地址中的setting.xml中的mirrors標(biāo)簽添加以下內(nèi)容,maven再次下載jar包時(shí),idea中看到,從阿里云提供的地址下載,速度比中央倉庫快
<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è)方法依然沒有解決,因?yàn)轫?xiàng)目都是其它同事一直能跑起來過的,那就說明程序肯定沒問題。主要我之前也是跑得好好的,也就換了一下系統(tǒng),Idea版本也安裝到2020.2.3 版本而已,到此心里感覺到了崩潰的邊緣,只想說這是為什么......
然后實(shí)在找不到問題所在 ,最后試著改了改pom.xml文件
<version>2.2.2.RELEASE</version>
居然和版本有關(guān)系,問題就解決了。
有的網(wǎng)友說檢查maven倉庫地址,將改為C:Usersxxx.m2repository,默認(rèn)地址。大家也可以試試。這種問題可能還是本地版本不太對應(yīng)導(dǎo)致,希望能幫助到大家。
也可以能有其他的問題,這方法不一定完全適應(yīng),僅供參考
如果大家有遇到Java-springboot的問題都可以加QQ群進(jìn)行交流:Java技術(shù)交流群:554101646
到此這篇關(guān)于解決IDEA springboot'spring-boot-maven-plugin'報(bào)紅問題的文章就介紹到這了,更多相關(guān)'spring-boot-maven-plugin報(bào)紅內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. 完美解決vue 中多個(gè)echarts圖表自適應(yīng)的問題2. PHP實(shí)現(xiàn)簡單線性回歸之?dāng)?shù)學(xué)庫的重要性3. 利用CSS制作3D動(dòng)畫4. Java GZip 基于內(nèi)存實(shí)現(xiàn)壓縮和解壓的方法5. jsp+servlet簡單實(shí)現(xiàn)上傳文件功能(保存目錄改進(jìn))6. JAMon(Java Application Monitor)備忘記7. SpringBoot+TestNG單元測試的實(shí)現(xiàn)8. Springboot 全局日期格式化處理的實(shí)現(xiàn)9. 存儲于xml中需要的HTML轉(zhuǎn)義代碼10. idea配置jdk的操作方法
