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

Duplicated classes for scijava 40.0.0 #1211

Open
tischi opened this issue Jan 17, 2025 · 2 comments
Open

Duplicated classes for scijava 40.0.0 #1211

tischi opened this issue Jan 17, 2025 · 2 comments

Comments

@tischi
Copy link
Contributor

tischi commented Jan 17, 2025

Hi @ctrueden and @tpietzsch,

When trying to mvn clean install the scijava 40.0.0 branch, I am getting lots of duplicate class errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-rules) on project mobie-viewer-fiji: 
[ERROR] Rule 3: org.codehaus.mojo.extraenforcer.dependencies.BanDuplicateClasses failed with message:
[ERROR] No Duplicate Classes Allowed!
[ERROR] - For duplicate transitive dependencies, add dependency exclusions.
[ERROR] - For duplications between direct dependencies, resolve or add
[ERROR]   ignored classes to this rule's configuration.
[ERROR] 
[ERROR]   Found in:
[ERROR]     jdk.tools:jdk.tools:jar:1.8:system
[ERROR]     com.sun:tools:jar:1.8.0:system
[ERROR]   Duplicate classes:
[ERROR]     sun/tools/serialver/Res.class
[ERROR]     sun/tools/jstat/Scale.class
[ERROR]     sun/rmi/rmic/newrmic/jrmp/RemoteClass.class
[ERROR]     com/sun/jdi/CharValue.class
[ERROR]     sun/tools/java/MethodSet$1MethodIterator.class
[ERROR]     sun/tools/native2ascii/Main.class
[ERROR]     com/sun/jdi/request/MonitorContendedEnteredRequest.class
[ERROR]     sun/tools/tree/EqualExpression.class
[ERROR]     sun/tools/asm/StringConstantData.class
....

There was already this line in the pom, probably added by one of you.

<allowedDuplicateClasses>${scijava.allowedDuplicateClasses},com.sun.xml.*,com.sun.tools.*,com.sun.istack.*,shaded.parquet.it.unimi.dsi.fastutil.*,javax.xml.bind.*,com.sun.xml.bind.*,com.sun.xml.txw2.*</allowedDuplicateClasses>

This did not suffice anymore and, in order not to have and endlessly long list here, I made this now more inclusive:

<allowedDuplicateClasses>${scijava.allowedDuplicateClasses},org.relaxng.*,sun.*,com.sun.*</allowedDuplicateClasses>

This works, is this OK?

@ctrueden
Copy link
Contributor

ctrueden commented Jan 17, 2025

Yes, looks fine to me. The only thing that might be an issue is the org.relaxng.*; where is that conflict coming from? Could it give you trouble with clashing versions in the future? Also: you didn't have any problems with the shaded.parquet.it.unimi.dsi.fastutil.*,javax.xml.bind.* no longer being there?

@tischi
Copy link
Contributor Author

tischi commented Jan 20, 2025

Hi @ctrueden, thank you for the feedback! I am completely swamped this week (multiple talks, retreats, ...); I will have to look at this at some later point in time. I guess this is not urgent as it seems to work as is for 40.0.0.

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