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

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

引用方式:

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

使用命令:

  1. Main Tasks
  2. dependencyTree: Shows an ASCII tree representation of the project's dependencies
  3. dependencyBrowseGraph: Opens a browser window with a visualization of the dependency graph (courtesy of graphlib-dot + dagre-d3).
  4. dependencyBrowseTree: Opens a browser window with a visualization of the dependency tree (courtesy of jstree).
  5. dependencyList: Shows a flat list of all transitive dependencies on the sbt console (sorted by organization and name)
  6. 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.
  7. dependencyLicenseInfo: show dependencies grouped by declared license
  8. dependencyStats: Shows a table with each module a row with (transitive) Jar sizes and number of dependencies
  9. 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.
  10. 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.
  11. dependencyGraph: Shows an ASCII graph of the project's dependencies on the sbt console (only supported on sbt 0.13)
  12. ivyReport: Lets ivy generate the resolution report for you project. Use show ivyReport for the filename of the generated report

样例:

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

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

虚线是被替代的依赖

  1. 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. 添加PROPAGATION_REQUIRES_NEW 事务没有产生作用

    最近在做事务添加时  发现自己的事务没有新建,上网查到   仅用作收藏. 其二  注意  事务的注解  应该在 内层的事务上面 一.描述Spring遇到嵌套事务时,当被嵌套的事务被定义为“PROPAG ...

  2. IntelliJ IDEA 2018 破解过程[详细步骤](Mac OS & Windows)

    注册码获取地址:http://idea.lanyus.com/ 1.软件下载 首先进入https://www.jetbrains.com官网进行下载. 2.下载破解包 可百度搜索JetbrainsCr ...

  3. sqlite当天时间的23:59:59

    select strftime('%Y-%m-%d %H:%M:%S','now','+1 day','localtime','start of day','-1 seconds')

  4. Django 1.9 + celery + django-celry 实现定时任务

    celery可以进行任务异步处理,celery还有一种Celery的常用模式便是执行定期任务. 执行定期任务时, Celery会通过celerybeat进程来完成. Celerybeat会保持运行, ...

  5. spring boot 项目部署在阿里云上

    装jdk, 然后 nohup java -jar xxxx.jar> system.log 2>&1 & lsof -i:9999 kill -9 1234

  6. 影响Arcmap运行效率的因素

    在使用ArcMap的过程中,总觉得ArcMap运行起来非常慢,目前发现了两点原因: 一.渲染太多图斑 比较常见的,我们在打开矢量图层时,Arcmap会自动渲染加载进去的图斑,进行符号化.在渲染的过程中 ...

  7. xampp 丢失api-ms-win-crt-runtimel1-1-0.dll 解决方案

    关于api-ms-win-crt-runtimel1-1-0.dll缺失的解决方案 原创 2016年02月29日 21:30:06 标签: 解决方案 / 补丁 / win7 / api-ms-win  ...

  8. 高通平台获取secure boot,串号等状态

    adb shell下 运行./system/bin/r address 其中address对应各个flag参数的地址,具体如下: 无法打开/dev/mem节点(没有该节点),这时只需在内核配置中选上C ...

  9. Linux----------httpd的简介和安装及使用

    目录 一.httpd的简介 二.常用httpd版本特性 (1)httpd-2.2 (2)httpd-2.4 三.httpd的工作模型 四.httpd的程序环境即配置文件和重要目录 1.配置文件和重要目 ...

  10. java8_api_misc

    属性文件处理    概念    加载并读取文件内容    修改文件内容    获取系统属性        该文件是一个文本文件,以properties作为其后缀,内容格式为    key1=value ...