Summary
I get the following error when trying to get coverage information for a test application when the classes are in a jar file when using jmockit-coverage 1.19:
JMockit: No classes were instrumented for coverage; please make sure that classes selected for coverage through the regular expression "com.qhrtech.emr.qa.*" are available from the runtime classpath, and that they have been compiled with debug information.
The information is correctly generated when I use jmockit-coverage 1.16 or other earlier versions.
It is also correctly generated if I have the class files outside the jar.
The application simply prints a message and waits for the user to press enter.
Steps to reproduce:
Compile the project: "mvn install".
Run the application from the command line with the following command:
"C:\Program Files\Java\jdk1.8.0_60\bin\java.exe" -classpath ./target/TestApp-1.0-SNAPSHOT.jar -javaagent:./target/runtimejars/jmockit-coverage.jar -Dcoverage-outputDir=./CodeCoverageReports -Dcoverage-classes=com.qhrtech.emr.qa.* -Dcoverage-metrics=line -Dcoverage-output=html-nocp com.qhrtech.emr.qa.testapp.TestApp
While the application is waiting for the user, attempt to generate code coverage information:
I updated my pom file to bring in jmockit-coverage version 1.20 from the Maven Central Repository, which looks like it has your fix, but I still get the same error.
Summary
I get the following error when trying to get coverage information for a test application when the classes are in a jar file when using jmockit-coverage 1.19:
JMockit: No classes were instrumented for coverage; please make sure that classes selected for coverage through the regular expression "com.qhrtech.emr.qa.*" are available from the runtime classpath, and that they have been compiled with debug information.
The information is correctly generated when I use jmockit-coverage 1.16 or other earlier versions.
It is also correctly generated if I have the class files outside the jar.
The application simply prints a message and waits for the user to press enter.
Steps to reproduce:
"C:\Program Files\Java\jdk1.8.0_60\bin\java.exe" -classpath ./target/TestApp-1.0-SNAPSHOT.jar -javaagent:./target/runtimejars/jmockit-coverage.jar -Dcoverage-outputDir=./CodeCoverageReports -Dcoverage-classes=com.qhrtech.emr.qa.* -Dcoverage-metrics=line -Dcoverage-output=html-nocp com.qhrtech.emr.qa.testapp.TestApp
Results
In the command window, the "No classes instrumented..." message is printed.
No output files are created in the output directory, CodeCoverageReports.
Versions
jmockit-coverage: 1.19 (from the Maven central repository)
Maven: 3.3.3
Java: JDK 1.8.0 u60
Source code:
===== src/main/java/com/qhrtech/emr/qa/testapp/TestApp.java =====
=====pom.xm=====
The text was updated successfully, but these errors were encountered: