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. golang struct

    ex1 /* https://golangbot.com/structs/ struct 结构 结构就是一组字段. */ package main import "fmt" // ...

  2. 移动端调用ArcGIS Server 10.1服务

    1.最好用mdb数据源,不要用shp文件作为数据源,一是属性字段长度超过5个字符会被截断,二是中文会变成乱码. 2.mxd的layer的坐标系要是WGS1984(4362),不然属性查询不出来.

  3. Mesh内存分配器的mmap小技巧

    最近看了一篇内存分配器的论文,原理很简单,但是里面的数学论证还没看懂,这次先简单写一下原理和用到的API. 内存分配器是用于封装操作系统提供的底层API,给应用程序提供动态内存的.内存不断申请释放后, ...

  4. 【集合】Java中的具体集合(一)

    Java中不止提供了集合框架中的接口,还提供了许多具体的实现. Java中的具体集合 集合类型 描述 ArrayList 一种可以动态增长和缩减的索引序列 LinkedList 一种可以在任何位置进行 ...

  5. es6里面的arr方法

    es6里面,关于arr的遍历以及查找,新增了很多的方法,对于不同的应用场景,运用合适的方法,可以达到事半功倍的效果: 一, arr.find():用于查找到符合条件的第一个成员,如果没有查找到的话,则 ...

  6. 关于xampp mysql字符编码与编译器编码不匹配问题

    今天,在php中对数据库字符字段进行查询的时候,语法之类的完全正确,但是就是查询不到结果,而在命令行中,同样的语句却能获得预期的功效.经多方面的了解之后才发现是字符编码不匹配的原因.在这里,把我的解决 ...

  7. 小妖精的完美游戏教室——人工智能,A*算法,导航网络篇

    //================================================================//// Copyright (C) 2017 Team Saluk ...

  8. MySQL下载与安装

    百度云网盘: https://pan.baidu.com/s/11ZIuXcNowp4_bVH4FLhyYA 提取码:ocuh MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发, ...

  9. 去掉win7快捷方式小箭头

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" ...

  10. [SQL] 从文本中提取数值

    现需求从上方测试数据的“备注”列中提取出金额 目前有两个方法比较容易实现: 1.首先比较容易想到的就是利用函数stuff删除掉所有的非数值字符. STUFF ( character_expressio ...