Closed ralbuh closed 1 year ago
Hi @ralbuh . There isn't enough information to know why this is happening. Does the stacktrace you posted have a caused by
sub-stacktrace?
Given the Template report creator was found (as you got the spec reports), there should be no way the aggregator report creator is not found as it's in the same jar.
You can actually verify that by doing something like jar tf spock-reports.jar | grep Aggregator
. If it's there, then there's no reason the JVM shouldn't find it.
This may have something to do with Java 17 module restrictions, but it's strange because I do test spock-reports on JDK 17 and it works. The report creator is created by reflection... but the class loading the report creator is from the same jar, so it makes no sense that the JVM will not allow that... could it be something related to Groovy's dynamic loading, so it looks like it's Groovy loading the class, not spock-reports classes?
at java.base/java.lang.Class.forName(Class.java:467)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.lambda$createCallStaticSite$2(CallSiteArray.java:63)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.doPrivileged(CallSiteArray.java:81)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:61)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:217)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:240)
at com.athaydes.spockframework.report.template.TemplateReportAggregator.writeOut(TemplateReportAggregator.groovy:59)
Maybe because of the Groovy indirection, you need to open the spock-reports package to the groovy jars... just a hunch but may be worth trying it.
By accident I found the problem. Some other project was having one extra dependency and that was working with similar setup. Adding the following dependency fixed the problem:
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-json</artifactId>
<scope>test</scope>
</dependency>
Oh interesting... that means that ReportDataAggregator
could not be instantiated because it was missing some class from the groovy-json
jar... the error should've included that information!
Recently we switched to newest java 17 with spring boot 3 (spring 6). This caused the reporting that was working before to start failing.
The following error occurs:
Maven dependencies:
groovy version is 4.0.12 automatically configured
spockReports config:
Separate html reports per specification are generated in build/spock-reports but after that it's not being aggregated and included in our asciidocs.
Would really appreciate some help since we do like and use the reports.