Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence duplicate-dependency-class for known duplication #103

Closed
drjasonharrison opened this issue Mar 27, 2017 · 3 comments
Closed

Silence duplicate-dependency-class for known duplication #103

drjasonharrison opened this issue Mar 27, 2017 · 3 comments

Comments

@drjasonharrison
Copy link

drjasonharrison commented Mar 27, 2017

I have a warning for duplicate classes between junit and hamcrest-core:

warning   duplicate-dependency-class         junit:junit:4.12 in configuration ':moduleA:compile' has 21 classes duplicated by org.hamcrest:hamcrest-core:1.3 (use --debug for detailed class list) (no auto-fix available)

I think I can ignore this warning because I have examined it and determined that junit is importing hamcrest-core and I believe that junit is doing the right thing:

+--- com.googlecode.json-simple:json-simple:1.1.1
|    \--- junit:junit:4.10
|         \--- org.hamcrest:hamcrest-core:1.1
  1. Is it safe to ignore this warning?
  2. Is there a way to silence this exact warning?
@DanielThomas
Copy link
Contributor

This rule is listing class files in the jars on a configuration, and looking for duplicates. This is what's causing the violation:

zipinfo -1 junit-4.10.jar | grep 'class$' | grep hamcrest
org/hamcrest/BaseDescription.class
org/hamcrest/BaseMatcher.class
org/hamcrest/CoreMatchers.class
org/hamcrest/Description.class
org/hamcrest/Factory.class
org/hamcrest/Matcher.class
org/hamcrest/SelfDescribing.class
org/hamcrest/StringDescription.class
org/hamcrest/core/AllOf.class
org/hamcrest/core/AnyOf.class
org/hamcrest/core/DescribedAs.class
org/hamcrest/core/Is.class
org/hamcrest/core/IsAnything.class
org/hamcrest/core/IsEqual.class
org/hamcrest/core/IsInstanceOf.class
org/hamcrest/core/IsNot.class
org/hamcrest/core/IsNull.class
org/hamcrest/core/IsSame.class
org/hamcrest/internal/ArrayIterator.class
org/hamcrest/internal/SelfDescribingValue.class
org/hamcrest/internal/SelfDescribingValueIterator.class

junit:junit:4.12 doesn't bundle these classes like this, and instead depends on hamcrest-core to provide them.

@drjasonharrison
Copy link
Author

So you're saying

  1. No, it isn't prudent to ignore this warning
  2. There is no way to silence the warning through Nebula.

Can you please provide pointers on how to address this issue? I can open an issue with Junit.

@DanielThomas
Copy link
Contributor

You can ignore the warning, but like I said, 4.12 doesn't bundle classes like this, so you can just upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants