詳解 maven的pom.xml用<exclusion>解決版本問題
詳解 maven的pom.xml用<exclusion>解決版本問題
用maven管理庫依賴,有個(gè)好處就是連同庫的依賴的全部jar文件一起下載,免去手工添加的麻煩,但同時(shí)也帶來了同一個(gè)jar會(huì)被下載了不同版本的問題,好在pom的配置里面允許用<exclusion>來排除一些不需要同時(shí)下載的依賴jar 。
比如配置struts-core,它會(huì)同時(shí)下載javassist和asm相關(guān)的jar,但版本又不夠新,這時(shí)可以排除它們:
<!-- Struts2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts.version}</version>
<exclusions>
<exclusion>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
<exclusion> <!-- we prefer our explicit version, though it should be the same -->
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion> <!-- we prefer our explicit version, though it should be the same -->
<groupId>asm</groupId>
<artifactId>asm-commons</artifactId>
</exclusion>
<exclusion> <!-- we prefer our explicit version, though it should be the same -->
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion> <!-- we prefer our explicit version, though it should be the same -->
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
如有疑問請(qǐng)留言或者到本站社區(qū)交流討論,希望通過本文能幫助到大家,謝謝大家對(duì)本站的支持!
相關(guān)文章
java實(shí)現(xiàn)表格tr拖動(dòng)的實(shí)例(分享)
下面小編就為大家分享一篇java實(shí)現(xiàn)表格tr拖動(dòng)的實(shí)例。具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2017-12-12
淺談Mybatis中resultType為hashmap的情況
這篇文章主要介紹了淺談Mybatis中resultType為hashmap的情況,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-12-12
springboot項(xiàng)目中mapper.xml文件找不到的三種解決方案
這篇文章主要介紹了springboot項(xiàng)目中mapper.xml文件找不到的三種解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-01-01
基于Mybatis-Plus攔截器實(shí)現(xiàn)MySQL數(shù)據(jù)加解密的示例代碼
用戶的一些敏感數(shù)據(jù),例如手機(jī)號(hào)、郵箱、身份證等信息,在數(shù)據(jù)庫以明文存儲(chǔ)時(shí)會(huì)存在數(shù)據(jù)泄露的風(fēng)險(xiǎn),因此需要進(jìn)行加密,解密等功能,接下來本文就給大家介紹基于Mybatis-Plus攔截器實(shí)現(xiàn)MySQL數(shù)據(jù)加解密,需要的朋友可以參考下2023-07-07
RedisTemplate.opsForHash()用法簡(jiǎn)介并舉例說明
redistemplate.opsforhash是RedisTemplate模板類中的一個(gè)方法,用于獲取操作哈希數(shù)據(jù)類型的接口,這篇文章主要給大家介紹了關(guān)于RedisTemplate.opsForHash()用法簡(jiǎn)介并舉例說明的相關(guān)資料,需要的朋友可以參考下2024-06-06
jbuilder2006連接sqlserver2000的方法
xp jbuiler2006 連接SQL SERVER2000的問題2008-10-10
一篇文章帶你搞定SpringBoot不重啟項(xiàng)目實(shí)現(xiàn)修改靜態(tài)資源
這篇文章主要介紹了一篇文章帶你搞定SpringBoot不重啟項(xiàng)目實(shí)現(xiàn)修改靜態(tài)資源,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09

