"Unrecognized option: --format=COBERTURAXML" in trying to convert JSCover report to cobertura xml

274 Views Asked by At

I'm trying to convert JSCover to cobertura xml.

Based on what i've read the command is as follows:

java -cp JSCover-all.jar jscover.report.Main --format=COBERTURAXML REPORT-DIR SRC-DIRECTORY

But I get an error

"Error: Could not find or load main class jscover.report.Main"

Even if I set the fully qualified path of there the JSCover-all.jar is located.

So I tried including the JSCover-al.jar into the classpath and run the following command instead:

java -cp jscover.report.Main --format=COBERTURAXML target/local-storage-proxy target/local-storage-proxy/original-src

I no longer get the first error but i'm now getting the following error:

Unrecognized option: --format=COBERTURAXML

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

I hope someone could help me with it. Many thanks!

1

There are 1 best solutions below

0
On

The first attempt is the correct approach. The error means that JSCover-all.jar is not in the same directory that you are executing the command from. An absolute path to is not needed - a relative one will do.

In the second approach, you have passed 'jscover.report.Main' as the class-path to the JVM and '--format=COBERTURAXML' as parameter to the 'java' command.