Closed sinwe closed 1 year ago
java.lang.NoClassDefFoundError: Could not initialize class com.athaydes.spockframework.report.internal.ReportDataAggregator
Interesting given that this class has been in spock-reports forever.
Do you have custom class loaders, custom Spock config or anything else that could be causing the classpath to be broken?
The only static initializers I see in this class that could be throwing an error are these:
static final charset = Charset.forName( 'utf-8' )
static final jsonParser = new JsonSlurper()
All JVMs are required to provide the utf-8 charset, so that shouldn't be an issue... JsonSlurper
is a Groovy JSON parser that as far as I know is present in every Groovy version and instantiating it should never throw. So there's not much to look at until you can give some more information, perhaps by attaching a debugger at this class and trying to capture the cause of the initialization problem.
Just crossed my mind you may be missing the groovy-json module in the classpath.
As explained in the README:
The only dependencies this project has are Groovy (only the groovy, groovy-templates, groovy-xml and groovy-json modules are required) and Spock, of course.
The test run without issue, IntelliJ and Maven doesn't report it as failure, but I report html file is generated, but it keeps throwing stacktrace as below
Versions: JDK: 11 spock-core: 2.0-groovy-3.0 spock-junit4: 2.0-groovy-3.0 spock-reports: 2.1.1-groovy-3.0 groovy: 3.0.8