詳解 maven的pom.xml用<exclusion>解決版本問題
詳解 maven的pom.xml用<exclusion>解決版本問題
用maven管理庫依賴,有個好處就是連同庫的依賴的全部jar文件一起下載,免去手工添加的麻煩,但同時也帶來了同一個jar會被下載了不同版本的問題,好在pom的配置里面允許用<exclusion>來排除一些不需要同時下載的依賴jar 。
比如配置struts-core,它會同時下載javassist和asm相關的jar,但版本又不夠新,這時可以排除它們:
<!-- 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ū)交流討論,希望通過本文能幫助到大家,謝謝大家對本站的支持!
相關文章
淺談Mybatis中resultType為hashmap的情況
這篇文章主要介紹了淺談Mybatis中resultType為hashmap的情況,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-12-12springboot項目中mapper.xml文件找不到的三種解決方案
這篇文章主要介紹了springboot項目中mapper.xml文件找不到的三種解決方案,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-01-01基于Mybatis-Plus攔截器實現(xiàn)MySQL數(shù)據(jù)加解密的示例代碼
用戶的一些敏感數(shù)據(jù),例如手機號、郵箱、身份證等信息,在數(shù)據(jù)庫以明文存儲時會存在數(shù)據(jù)泄露的風險,因此需要進行加密,解密等功能,接下來本文就給大家介紹基于Mybatis-Plus攔截器實現(xiàn)MySQL數(shù)據(jù)加解密,需要的朋友可以參考下2023-07-07RedisTemplate.opsForHash()用法簡介并舉例說明
redistemplate.opsforhash是RedisTemplate模板類中的一個方法,用于獲取操作哈希數(shù)據(jù)類型的接口,這篇文章主要給大家介紹了關于RedisTemplate.opsForHash()用法簡介并舉例說明的相關資料,需要的朋友可以參考下2024-06-06jbuilder2006連接sqlserver2000的方法
xp jbuiler2006 連接SQL SERVER2000的問題2008-10-10一篇文章帶你搞定SpringBoot不重啟項目實現(xiàn)修改靜態(tài)資源
這篇文章主要介紹了一篇文章帶你搞定SpringBoot不重啟項目實現(xiàn)修改靜態(tài)資源,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-09-09