当前位置:网站首页>Jar version conflict resolution
Jar version conflict resolution
2022-06-26 10:14:00 【Miming】
background
In the process of bank channel connection , Some channels rely on their own encryption and decryption sdk Or algorithm for data encryption transmission , Some come with them sdk And underlying dependencies jar There will be version conflicts (A Bank SDK rely on 0.0.1 Of jar a,B Of the bank jar Version depends on 0.0.5 Of jar a), It is uncertain whether the corresponding bank has any dependence jar Under the premise of personalized development and optimization , because maven The reason for version management , If you do not distinguish between versions , This will lead to the wrong introduction of a lower version of jar, As a result, multiple channels cannot be shared , This article is to deal with a compromise solution under this premise .
Treatment scheme
The main solution is : By modifying the corresponding conflict jar The root package prefix of is the same as maven Upper groupId、artifactId and version, So as to distinguish the dependence of each channel jar
It's about tools
jarjar.jar
jd-gui.exe
Processing steps
1. new directory , hold jarjar.jar And what needs to be adjusted jar Put it in the directory :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-njyp1Pw8-1654159721627)(http://10.0.17.20/server/index.php?s=/api/attachment/visitFile/sign/a5f5f71e864ab18709d431f19e6c1c19)]](/img/f4/d48943d9cd47d649b42a27322f0fe8.png)
2. newly added rule.txt file , The content of the document is :
( The original root package name uses the decompiler jd-gui.exe Open view )
rule Original package name .** Target package name [email protected]
Such as :rule org.bouncycastle.** [email protected]
3. Use cmd Switch to the current directory :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-qt5LO4YO-1654159721629)(http://10.0.17.20/server/index.php?s=/api/attachment/visitFile/sign/70629fc8a50b47db6b1b1257e61d348f)]](/img/0a/a8324d9bd1bca7b3dca1b5cac15dd7.png)
4. stay cmd Execute the following command under the window :
java -jar jarjar.jar process rule.txt What needs to be revised .jar The modified .jar( The modified jar Name customization )
Such as : java -jar jarjar.jar process rule.txt bcpg-jdk15on-1.64.jar test.bcpg-jdk15on-1.64.jar
5. Generated new test.bcpg-jdk15on-1.64.jar Use jd-gui.exe Decompile and discover , all class The root package of the file has been changed to dbs.org.bouncycastle start :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-FjfnSNFJ-1654159721631)(http://10.0.17.20/server/index.php?s=/api/attachment/visitFile/sign/3b75dcf58143aef479df5fcaedc1aaa7)] The goal is jar Package root package name](https://img-blog.csdnimg.cn/0cc1feea724e4bdfbff1fc75b69978e6.png)
original jar Package root package name 
The goal is jar Package root package name
6. Log on to remote maven Private clothes , Then use the upload function , In this way, the project can pass maven The way to manage .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-xLhVRGuX-1654159721634)(http://10.0.17.20/server/index.php?s=/api/attachment/visitFile/sign/e444baa7fbd082ee4cd7cf86d208b566)]](/img/ad/55485491d632dd6c7f8acc38792955.png)
边栏推荐
- When will JVM garbage collection enter the older generation
- Go learning notes (83) - code specification and common development skills
- Openxcap usage
- SSM项目小例子,SSM整合图文详细教程
- 118. Yanghui triangle
- Various errors encountered by tensorflow
- Getting started with Flink - word statistics
- Leetcode basic calculator 224 227. follow up 394
- 瑞萨电子面向物联网应用推出完整的智能传感器解决方案
- LeetCode 498. Diagonal traversal
猜你喜欢

String constant pool, class constant pool, and runtime constant pool

Extracting public fragments from thymeleaf

904. 水果成篮

Allocation of heap memory when creating objects

P1296 whispers of cows (quick row + binary search)

SSM项目小例子,SSM整合图文详细教程

#云原生征文# 在 Google Kubernetes Cluster 上使用 HANA Expression Database Service

C中字符串基本操作

String constant pool, class constant pool, and runtime constant pool

Solution to network request crash in retrofit2.8.1
随机推荐
【LeetCode】59. Spiral matrix II
Leetcode connected to rainwater series 42 (one dimension) 407 (2D)
The third-party extension package of thinkphp6.0 supports uploading to Alibaba cloud and qiniu cloud
Do you know the //go: instructions in the go source code, go:linkname?
Meaning of go runtime
What is the web SSH service port of wgcloud
微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复
Mysql database operation commands (constantly updated)
Configuration internationale
【LeetCode】59. 螺旋矩阵 II
國際化配置
【無標題】
The basis of C language grammar -- pointer (multidimensional array, function, summary) learning
Appium automation test foundation - mobile end test environment construction (II)
Introduction to stored procedure testing
Learning and understanding of thread pool (with code examples)
Battery historian analyzes battery consumption
Getting started with Flink - word statistics
c语言语法基础之——函数 小程序 求阶乘
druid数据源实现后台监控