jar包依赖冲突,版本不兼容会导致各种各样的问题。这里推荐一款sbt插件用于查找项目中的jar包依赖关系,通过该插件可以轻松的看出某个jar包依赖哪些jar,以及某个jar被哪些jar所依赖。此外该插件还可生成可视化图形用于查看依赖关系。

插件地址:https://github.com/jrudolph/sbt-dependency-graph

引用方式:

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2")

使用命令:

Main Tasks
dependencyTree: Shows an ASCII tree representation of the project's dependencies
dependencyBrowseGraph: Opens a browser window with a visualization of the dependency graph (courtesy of graphlib-dot + dagre-d3).
dependencyBrowseTree: Opens a browser window with a visualization of the dependency tree (courtesy of jstree).
dependencyList: Shows a flat list of all transitive dependencies on the sbt console (sorted by organization and name)
whatDependsOn <organization> <module> <revision>?: Find out what depends on an artifact. Shows a reverse dependency tree for the selected module. The <revision> argument is optional.
dependencyLicenseInfo: show dependencies grouped by declared license
dependencyStats: Shows a table with each module a row with (transitive) Jar sizes and number of dependencies
dependencyGraphMl: Generates a .graphml file with the project's dependencies to target/dependencies-<config>.graphml. Use e.g. yEd to format the graph to your needs.
dependencyDot: Generates a .dot file with the project's dependencies to target/dependencies-<config>.dot. Use graphviz to render it to your preferred graphic format.
dependencyGraph: Shows an ASCII graph of the project's dependencies on the sbt console (only supported on sbt 0.13)
ivyReport: Lets ivy generate the resolution report for you project. Use show ivyReport for the filename of the generated report

样例:

 dependencyTree:按照树的方式列出所有的jar依赖关系

dependencyBrowseTree:绘制依赖关系图,以*.html文件保存,可在浏览器中打开查看

虚线是被替代的依赖

whatDependsOn: 查看指定jar被哪些jar所依赖。使用方式:whatDependsOn <org> <module> <version>
   例如:whatDependsOn com.google.code.gson gson 2.8.0

===============================================

原文链接:jar包冲突排解方法(sbt) 转载请注明出处!

===============================================

---end

jar包冲突排解方法(sbt)的更多相关文章

  1. 【Maven】【IDEA】在idea中开发web项目,解决maven的jar包冲突的方法

    在idea中开发web项目,解决maven的jar包冲突的方法 第一步: 先对项目进行 clean ,再进行install 第二步: 出现NoSuchMethodException,ClassNotF ...

  2. tomcat web工程 jar包冲突解决方法

    目前在部署工程时,遇到了一个问题,报错信息如下: See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet ...

  3. jar包冲突解决方法

    import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.Enumerati ...

  4. sbt公布assembly解决jar包冲突 deduplicate: different file contents found in the following

    一个.问题定义 近期使用sbt战斗assembly发生故障时,包,在package什么时候,发生jar包冲突/文件冲突,两个相同class来自不同jar包classpath内心冲突. 有关详细信息:我 ...

  5. jar包冲突常用的解决方法

    jar包冲突常见的异常为找不到类(java.lang.ClassNotFoundException).找不到具体方法(java.lang.NoSuchMethodError).字段错误( java.l ...

  6. 通过一次SpringBoot打成war包部署到tomcat启动总结一般jar包冲突的解决方法

    启动时,报错信息如下: 28-Sep-2018 16:55:41.567 严重 [localhost-startStop-1] org.apache.catalina.core.StandardCon ...

  7. xml-apis.jar getTextContent() jar包冲突解决(getTextContent()方法无法找到)

    1.引用包: import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList; 2.方法中应用: ...

  8. Maven项目-jar包冲突:MyServlet is not a Servlet解决方法

    异常显示:运行时jar包冲突异常 问题所在: jar包冲突,自己导入的jar包与tomcat中的jar包相同. 解决方法: 对(servlet,jsp)jar包设置作用域. 再次启动项目,问题已解决.

  9. 为什么项目的jar包会和tomcat的jar包冲突?

    为什么项目的jar包会和tomcat的jar包冲突? 碰到这个问题,猜测tomcat启动时会将自己的lib和项目的lib在逻辑上归并为一个大的lib,但是并没有做版本区分以及去重,这样相同的包可能就有 ...

随机推荐

  1. PHP为什么有人学不会

    互联网进入到人们生活中的方方面面了,世界首富比尔盖茨多次提到青少年编程,而编程是一种思维习惯的转化. 作为写了10几年程序的人,我听到过一些说编程不好学的抱怨. 从目前见到的数据统计,主要是因为在大学 ...

  2. Java中语法与C/CPP的区别

    static不能在成员方法中定义,只能作为类变量定义.

  3. HD ACM 水题顺序

    原文传送门:http://acm.hdu.edu.cn/ 第一阶段:开始入门吧!(15天,53题) 一.输入输出练习(2天,10题) 1000.1089-1096.1001 二.简单操作:(2-4天, ...

  4. DPDK - gsg文档(介绍与编译)

    && Hugepage 提前分配hugepage内存,可以减少虚拟页地址转换到物理地址所需的时间. 相关命令: 在虚拟机上运行时,在没有NUMA的机器上,执行“echo 1024 &g ...

  5. 一种hyperscan API使用(1)

    hyperscan: 编译和安装:http://www.cnblogs.com/zzqcn/p/4900643.html 简单介绍:http://www.cnblogs.com/zzqcn/p/489 ...

  6. c++学习中的疑问

    1.关于iostream头文件中的cout对象没有包含对string的<<操作符重载函数 测试代码: #include<iostream> using namespace st ...

  7. Unity备份新知识待写

    Unity开发VR之Vuforia 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Chinar -- ...

  8. Uva10562——Undraw the Trees

    上来一看感觉难以下手,仔细想想就是dfs啊!!!! #include <cstdio> #include<iostream> #include<iomanip> # ...

  9. react安装

    1. npm install -g create-react-app 2. create-react-app my-app 3. cd my-app npm start 4.浏览器打开  http:/ ...

  10. npm -D -S 的区别

    npm -D -S 的区别   我们在使用npm install 安装模块或插件的时候,有两种命令把他们写入到 package.json 文件里面去,比如: --save-dev --save 在 p ...