idea怎樣導入Thymeeaf模板引擎,以及遇到的不能下載依賴的問題解決方法

一、導入thymeleaf

idea中thymeleaf的導入非常簡單,就是將thymeleaf依賴加入到pom.xml文件中即可。

1、Thymeleaf 官網:https://www.thymeleaf.org/

2、Thymeleaf 在Github 的主頁:https://github.com/thymeleaf/thymeleaf

3、Spring官方文檔:“https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/htmlsingle/#using-boot-starter” 

上面這些是可以找到相對應thymeleaf文件的網址(我一般用第三個,下面也以第三個爲例) 

找到thymeleaf文件點擊右邊的pom文件即可,然後複製到自己項目的pom文件中

二、相關問題

有些人會遇到在pom文件中導入thymeleaf依賴時無法想在相應的jar包(jar包下載時爆紅,不嫩那個下載的錯誤),這個是因爲idea默認的鏡像是在外國,一般進外國網站都比較慢,而且需要翻牆,但是加入阿里雲之後,就讓idea去阿里雲那邊下載,阿里雲網速快。 默認配置的網站速度慢。相關的方法如下:

右鍵點擊項目名,找到maven ,打開settings.xml

加入如下代碼

<mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

修改後就會下載很快啦。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章