Search code examples
javamavenexecutable-jardynamic-reports

DynamicReports cause "Cannot load main class"


I'm using DynamicReports via Maven and when I'm trying to build my jar I can't run it afterward. I get the exception "Cannot find or load the main class." The code works perfectly in IntellijIDE but not in executable jar.

If I remove the DynamicReports maven dependencies my jar can run. It seems like if I was missing a dependency when adding DynamicReports. What did I miss?

EDIT : I even tried to remove the maven dependency and add their jar instead with provided libs and it does the same. but when I remove them everything works...

This is the META-INF/MANIFEST.MF of my jar

Manifest-Version: 1.0
Main-Class: ca.tecsar.punch.PunchEntry

And at the "root" inside my jar I do have ca/tecsar/punch/PunchEntry.class


Solution

  • Seems like DynamicReports has BouncyCastle as dependency and I had to change how my artifact is built by not extracting Bouncy Castle and just put the BouncyCastle Jar into mine from Intellij. Seems to work now.