IntegrationTest fails with cobertura

I wanted to generate the coverage report for my project. For that, I found that I can use cobertura [https://stackoverflow.com/questions/2006014/how-to-generate-cobertura-code-coverage-report-using-maven-from-hudson]. I added the following in pom.xml for java 11

         <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>2.5.2</version>
          <configuration>
            <classesDirectory>./test</classesDirectory>
            <formats>
              <format>xml</format>
            </formats>
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>cobertura</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

When I am running mvn cobertura:cobertura I am getting java.lang.ClassFormatError: Nest member class_info_index 35 has bad constant type in class file which is not closed, I think. When I am running mvn clean package the file runs but is not producing the .xml file. Is there any way in which I can achieve the coverage report.