openclover/clover

pre main class not found error

Closed this issue · 1 comments

I am using OpenClover to statically inject a Java agent into my Tomcat application after editing catalina.sh like -> JAVA_OPTS="$JAVA_OPTS -javaagent:/path/to/clover.jar" to get a code coverage report. However, Tomcat is failing to start because the premain class is missing from the manifest. I am planning to get code coverage for my build by performing UI checks manually as well as in UI automation using Selenium.
I have checked the manifest file and confirmed that the premain class is missing.
Am i using wrong jar file or what?
Can anyone provide me steps to achieve it.

I tried using Jacoco but i don't face any issue.

Additional information
Class file is already compiled as jar and placed in tomcat server application lib
I just want code coverage for this class files. I can also reference .java files externally if needed

Hi. OpenClover is not a Java agent (like JaCoCo is). Add clover.jar to the classpath instead. Please remember that you have to instrument source code using OpenClover (i.e. instrument and compile). Please refer to online documentation how to integrate OpenClover with your CI.