I am building a plugin with Maven and would like to use the Apache poi-ooxml library to work with .xls files.
I am currently playing around with the example plugin https://github.com/imagej/example-legacy-plugin to learn how to use Maven.
I have imported the project into Eclipse and have added the dependency to the pom:
I am able to use all the functionality such as Workbook, Sheet, and Cell for my purposes in Eclipse.
However when packaging my project through command line (mvn package), I run into an Enforcer Rule error (" Rule 2: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message: No Duplicate Classes Allowed!").
I am warned that I have duplicate classes in apache xmlbeans, which I have tried excluding in my dependencies. This does yield a successful compile however I am unable to use some of the classes from poi-ooxml that I wanted.
I have also tried running the -Denforcer.skip=true flag but this does not seem to package my project correctly (Imagej is not able to find my main class files when I drag my jar file into the plugins folder).
The only other dependencies I have included is net.imagej ij which was included in the example project.
Any advice on using poi-ooxml in imagej plugins?