type
status
date
slug
summary
tags
category
icon
password
 
在Java代码中,如何快速解决jar包冲突问题,可以借助idea插件 Maven helper快速解决jar包冲突问题。
 
 
notion image
 

安装

点击设置,搜索maven helper 插件,然后选择安装。
notion image
notion image
安装完成后,重启idea.

使用

打开项目文件pom.xml后,可以发现文件的底端多了个“Dependency Analyzer”的选项。
notion image
切换到“Dependency Analyzer”视图后,可以发现如下界面
notion image
其中三个选项分别表示如下:
  • Conflicts---------查看冲突
  • All Dependencies as List---------列表形式查看所有依赖
  • All Dependencies as Tree---------树形式查看所有依赖
3、当没有依赖冲突或者解决依赖冲突时,当选择Conflicts时,右上角会多了个“No Conflicts”
notion image
当出现冲突需要解决时,下面会显示冲突的信息,我们可以选择冲突的依赖 Exclude它。
notion image
5、点击 Exclude 之后,插件自动会在 pom.xml 文件中添加 <exclusion> 相关代码,进行子依赖的排除。

其他方法

1、IEDA其他快捷键
  • 可以使用快捷键 Ctrl+Shift+AIt+U(idea默认的快捷键),直接显示出依赖关系树
notion image
  • 选择右侧maven,点击右上角“Show Dependencies”图标后,会显示出依赖关系图。
    notion image
    notion image
    2、使用Maven命令查看依赖冲突方法:
    • 查看依赖:
    • 查看依赖是否冲突:
     
     
     
     
    💡
    有关插件安装或者使用上的问题,欢迎您在底部评论区留言,一起交流~
    PowerDesigner?国产PDManer你值得尝试Ant Design 使用出现 Error: Can‘t resolve ‘~antd/dist/antd.css‘
    • Twikoo
    • Giscus
    • Cusdis
    Nolan
    Nolan
    靠天吃饭自由人🍚
    公告
    🎉欢迎来到阿豪的小站🎉
    😊大家好,我是阿豪
    🌱热爱看书、冥想、听播客、徒步
    👯喜欢交朋友,很高兴能认识你!
    免责声明
    ⚠️本站所有内容仅代表作者个人观点。内容仅供学习和交流使用,可以转载,但请注明出处。
    ⚠️用户使用信息时请自行核实,本站不对信息的准确性、完整性或使用后果承担责任。遵守相关法律法规,不得用于非法目的。
     
    2023-2024 Nolan.

    NotionNext BLOG | 靠天吃饭自由人🍚

    Powered by Nolan.