I'm trying to build a basic imagej plugin using bioformats to enable me to open czi files etc. However, when I add the bioformats dependency the maven plugin BanDuplicateClasses fails. These are the dependencies in my pom file
<dependencies>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej</artifactId>
</dependency>
<dependency>
<groupId>ome</groupId>
<artifactId>bio-formats_plugins</artifactId>
<version>6.1.0-m1</version>
</dependency>
</dependencies>
And the parent pom file where the maven plugin causing the problem seems to originate
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>26.0.0</version>
<relativePath />
</parent>
This is the error that it throws when I try to package it
[WARNING] Rule 3: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message:No Duplicate Classes Allowed!
- For duplicate transitive dependencies, add dependency exclusions.
- For duplications between direct dependencies, resolve or add ignored classes to this rule's configuration.
Found in:
commons-io:commons-io:jar:2.6:runtime
ch.systems.cisd:jhdf5:jar:14.12.0:compile
Duplicate classes:
org/apache/commons/io/FileCleaningTracker.class
org/apache/commons/io/comparator/SizeFileComparator.class
org/apache/commons/io/output/ProxyWriter.class
org/apache/commons/io/input/CloseShieldInputStream.class
org/apache/commons/io/FileCleaningTracker$Tracker.class
..........
I tried to remove these dependencies from the bioformats dependency using
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
but this didn't work (probably unsurprisingly since I don't know what I'm doing)
How do I go about fixing this?