神奇解决NoClassDefFoundError版本不同的问题

栏目: Java · 发布时间: 6年前

内容简介:你是否有碰到这个错误:java.lang.NoClassDefFoundError: XXXXXX一般这是由同一个软件不同版本导致,然后你会花几个小时尝试统一成一个版本后就解决了。

你是否有碰到这个错误:

java.lang.NoClassDefFoundError: XXXXXX

一般这是由同一个软件不同版本导致,然后你会花几个小时尝试统一成一个版本后就解决了。

现在只要下载这个开源的工具depends,然后运行:

java -jar build/libs/depends-1.0-SNAPSHOT.jar com.mycompany.app:my-app:1.0-SNAPSHOT --filter=JsonParseException

你获得一个有用的报告:

broken apis:
         com.fasterxml.jackson.core.JsonParseException.getMessage()Ljava/lang/String; is only present in 
        [com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.9.6]]

        com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;Ljava/lang/Throwable;)V is only present in 
        [com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]

        com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;)V is only present in 
        [com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]

        com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;Lcom/fasterxml/jackson/core/JsonLocation;)V is only present in 
        [com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]

从列表中选择一个版本!

下载方式:

  1. git clone https://github.com/bgard6977/depends.git
  2. ./gradlew build

工作原理:

  1. 它使用 ShrinkWrap Resolver 构建项目的依赖关系图。
  2. 它扫描每个jar中的类,并使用 ASM4 查找函数调用。
  3. 它构建了所有跨模块函数调用的映射。
  4. 它假设从外部模块调用的任何函数都是公共API。
  5. 它会比较每个模块的所有版本,以查看所有版本中不存在哪些方法。
  6. 它按给定的搜索词过滤这些内容。
  7. 最后,它打印一份报告,以帮助您确定在依赖性冲突产生时使用的版本。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

CSS3 Solutions

CSS3 Solutions

Marco Casario / Apress / 2012-8-13 / GBP 35.50

CSS3 brings a mass of changes, additions, and improvements to CSS across a range of new modules. Web designers and developers now have a whole host of new techniques up their sleeves, from working wit......一起来看看 《CSS3 Solutions》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具