如何忽略或修复重复的类警告? [英] How to ignore or fix the duplicate classes warning?

查看:35
本文介绍了如何忽略或修复重复的类警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Qulice 代码质量控制工具.

I'm trying to use the Qulice code quality control tool.

在我的项目上运行 qulice:check 时,出现以下错误:

When I run qulice:check on my project, I get the following errors:

[WARNING] Found duplicate and different classes in [junit:junit:4.8.2,org.mockito:mockito-all:1.9.5] :
[WARNING]   org.hamcrest.BaseDescription
[WARNING]   org.hamcrest.BaseMatcher
[WARNING]   org.hamcrest.CoreMatchers
[WARNING]   org.hamcrest.Description
[WARNING]   org.hamcrest.Factory
[WARNING]   org.hamcrest.Matcher
[WARNING]   org.hamcrest.SelfDescribing
[WARNING]   org.hamcrest.StringDescription
[WARNING]   org.hamcrest.core.AllOf
[WARNING]   org.hamcrest.core.AnyOf
[WARNING]   org.hamcrest.core.DescribedAs
[WARNING]   org.hamcrest.core.Is
[WARNING]   org.hamcrest.core.IsAnything
[WARNING]   org.hamcrest.core.IsEqual
[WARNING]   org.hamcrest.core.IsInstanceOf
[WARNING]   org.hamcrest.core.IsNot
[WARNING]   org.hamcrest.core.IsNull
[WARNING]   org.hamcrest.core.IsSame
[WARNING]   org.hamcrest.internal.ArrayIterator
[WARNING]   org.hamcrest.internal.SelfDescribingValue
[WARNING]   org.hamcrest.internal.SelfDescribingValueIterator

我试图禁用这些检查,但是根据 Qulice GitHub ,此功能是尚未实施.

I tried to disable those checks, but according to Qulice GitHub, this feature isn't implemented yet.

我该怎么做才能摆脱这些错误?

What can I do in order to get rid of these errors?

推荐答案

您能做的最好的是:

<plugin>
  <groupId>com.qulice</groupId>
  <artifactId>qulice-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>duplicatefinder:.*</exclude>
    </excludes>
  </configuration>
</plugin>

pom.xml 中查看其操作方法.您基本上是在禁用整个重复查找程序检查.目前,无法仅禁用一个工件.

See how it's done in pom.xml of rultor, for example. You're basically disabling the entire duplicate finder check. There is no way to disable just one artifact, at the moment.

ps.在您的特定情况下,您无需禁用重复查找程序.只需使用正确版本的JUnit,Mockito和Hamcrest,请在jcabi-parent

ps. In your specific case, you don't need to disable duplicate finder. Just use proper versions of JUnit, Mockito, and Hamcrest, see how it's done in jcabi-parent pom.xml.

这篇关于如何忽略或修复重复的类警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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