在类路径中查找重复的类 [英] Find duplicated classes in classpath

查看:157
本文介绍了在类路径中查找重复的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Maven构建的Java应用程序,它有很多依赖项。在执行我的测试用例时,它们有时会很好地通过,有时它们会因为一些不兼容的类组合而失败。所以似乎在类路径中必须有两次随机获取的类。一个是好的,另一个没有。

I have a Java application built with Maven with a lot of dependencies. When performing my test cases they sometimes pass fine, sometimes they fail because of some incompatible class combinations. So it seems to that there must be some classes twice in classpath which are taken randomly. The one is fine the other not.


  • 如何找出哪些类/罐在我的类路径中不兼容?

  • 使用Maven的正确方法是什么,不要陷入兼容性陷阱?

推荐答案

我认为更好的解决方案是使用 maven-duplicate-finder-插件

I think a better solution would be to use the maven-duplicate-finder-plugin.

注意:新版本是 duplicate-finder-maven-plugin

这篇关于在类路径中查找重复的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆