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

Finer-grained ignore patterns #23

Closed
jimshowalter opened this issue Feb 28, 2016 · 8 comments
Closed

Finer-grained ignore patterns #23

jimshowalter opened this issue Feb 28, 2016 · 8 comments

Comments

@jimshowalter
Copy link

Often duplicates exist between two JARs and those duplicates need to be ignored, but it is not desirable to ignore either JAR entirely. We just want to ignore their mutual dependencies, while still catching other duplications (for example, a third JAR that introduces unwanted duplicates between it and the two JARs with allowed duplicates).

In our homegrown duplicate finder, we can define JAR-to-JAR whitelisted pairs, and also class-to-JAR whitelisted pairs.

For example:

Whitelisted JAR pairs:
jre/lib/rt.jar:
----rt/lib/endorsed/webservices-api-2.0.1.jar
----rt/tomcat/lib/tomcat-annotations-api-7.0.39.jar
----rt/tomcat/shared/lib/webservices-extra-2.0.1.jar
----rt/tomcat/shared/lib/webservices-rt-2.0.1.jar
rt/lib/endorsed/webservices-api-2.0.1.jar:
----jre/lib/rt.jar
rt/tomcat/lib/tomcat-annotations-api-7.0.39.jar:
----jre/lib/rt.jar
----rt/tomcat/shared/lib/webservices-extra-2.0.1.jar

Whitelisted class/JAR pairs:
com.intuit.ims.shared.enums.ImsOffering:
----rt/lib/ims-shared-1.0.14-SNAPSHOT.jar
----rt/lib/ipsaccount-3.2.0-rel-0.jar
javax.transaction.TransactionRequiredException:
----jre/lib/rt.jar
----rt/lib/jboss-transaction-api-1.0.1.GA.jar
javax.transaction.TransactionRolledbackException:
----jre/lib/rt.jar
----rt/lib/jboss-transaction-api-1.0.1.GA.jar
org.aspectj.internal.lang.reflect.StringToType:
----rt/lib/aspectjrt-1.7.4.jar
----rt/lib/aspectjtools-1.8.4.jar
----rt/lib/aspectjweaver-1.8.4.jar
org.bouncycastle.jcajce.DefaultJcaJceHelper:
----rt/lib/bcmail-jdk16-1.46.jar
----rt/lib/bcprov-jdk15on-1.49.jar

We want to replace our homegrown duplicate finder with duplicate-finder-maven-plugin, but don't want to give up the fine-grained ignore controls.

@stevenschlansker
Copy link
Contributor

I think we'd happily accept any contribution (with tests) making this more flexible, but I'm not sure that the committers have time to work on it ourselves right now. I would happily help shepherd a PR, though!

@jimshowalter
Copy link
Author

I will try to do that--thanks! What is a PR?

@stevenschlansker
Copy link
Contributor

Pull request, nothing more than GitHub's fancy UI over a branch you create with your changes.

@jimshowalter
Copy link
Author

Face. Palm. I know what a pull request is, just didn't associate the abbreviation.

@mbellomo
Copy link
Contributor

mbellomo commented Mar 2, 2016

The changes that I made in this PR: #16

Should be able to do what you want.

@jimshowalter
Copy link
Author

mbellomo, can you give an example of how a regex would be used to say com.foo.bar.Baz is allowed to be a duplicate in jar-1 and jar-2, but not in any other JARs?

@mbellomo
Copy link
Contributor

mbellomo commented Mar 4, 2016

We tend to use it like this (which is why I wrote the changes):

        <failBuildInCaseOfDifferentContentConflict>true</failBuildInCaseOfDifferentContentConflict>
        <ignoredClassPatterns>
          <!-- Ignore all classes that aren't from our company -->
          <ignoredClassPattern>^((?!com[/.]mycompany).*)$</ignoredClassPattern>
        </ignoredClassPatterns>

I don't care if we have duplicate classes from jars that aren't ours...as long as the content matches. We are mostly concerned w/ our stuff.

That might not be exactly what you want given that latest comment though.

-Michael

@hgschmie
Copy link
Contributor

There is #16 merged a long time ago and this thread has gone quiet, so I assume that what is in duplicate finder now is good enough. Closing this thread, please reopen if necessary

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

4 participants