当前位置:网站首页>Idea resolving jar package conflicts

Idea resolving jar package conflicts

2022-07-06 16:59:00 Xiaoxiamo

brief introduction

Because usually the project is integrated jar Bao Tai , I encountered a package conflict problem today , Projects that can run yesterday , today Suddenly it can't run 了 ( Later I learned that it was because of the new addition of dependency , There was a conflict ), also The error prompt is inconsistent with the actual situation , This kind of problem is very troublesome , Only try slowly

resolvent

  • Find conflicting packages
    Click the button in the picture , Or use the shortcut key Ctrl+Alt+Shift+u
     Insert picture description here
    As long as there is a red line , It means that there are conflicting packages ( Here is a brief explanation , Generally, the probability of package conflict in development is not much , But like me , What kind of HugeGraph, This niche project , It's very likely that )
     Insert picture description here
    Click on maven The upper left corner of the dependency tree ,Show Conflicts/Duplicates, All conflicting dependencies can be displayed
     Insert picture description here
    After clicking, my display is
     Insert picture description here
  • Choose a version jar Package to delete
    Here select one to delete jar package , The selection criteria are Choose a higher version or lack some methods jar Delete , For example, we should use the new feature method of high version , Then delete the lower version jar, If you don't use new methods , Just delete the higher version like me ,( Don't worry about deleting mistakes )
    Left click to select the dependency to delete
     Insert picture description here
    Right click and choose Exclude Or just press the shortcut key Shift+ Delete, You can delete
     Insert picture description here

For example, after I delete , The previous conflict dependency disappeared
 Insert picture description here

  • Deletion error jar How to recover the package
    Here, considering that we may delete the wrong jar package , How to recover after deleting an error ? We turn on pom.xml file , You can see , Our delete operation just makes maven Excluding this package , It is not a physical deletion , If we want to recover , Remove the excluded content from pom.xml Delete from , The conflict reappears !
     Insert picture description here
  • Finally, I would like to thank these bosses who found the problem
    I am using HugeGraph Figure database is very small , all 2021 了 , There is no official version , If something goes wrong, you can't find it , Here is an important lesson , Read more official documents , If something goes wrong, we can't find it. We can consider Inquire about Github Of Issues, Of course, we'd better mention it ourselves , You can also view the history of project updates , Maybe your problem is in the new version fix 了 , End

 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[Xiaoxiamo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131312513612.html