JMockit version: 1.26
The file path in the coverage.xml is "com/mycorp/MyClass.java"
It should be "src/main/java/com/mycorp/MyClass.java"
Ok, but how can JMockit know that the source file is under the "src/main/java/" directory, rather than, say, "src/"?
The coverage tool obtains "com/mycorp/MyClass.java" from the "MyClass.class" file, which comes from some "classes/" directory somewhere, usually. To figure out what directory is the correct source root, it would need to search the filesystem (as the HTML report does, but that one needs to locate the sources anyway in order to read them). I would think that generation of an XML data file would not need to be concerned with the location of source files.
If the coverage.xml file is inteded to follow the conventions of the Sonar Qube generic coverage file (http://docs.sonarqube.org/display/PLUG/Generic+Test+Coverage), it should contain the file name of the Java file relative to the module root. The sourceDir is already a configuration parameter. And as you say, the HTML report already tries to find the source file.
Ok, it says the path should be "relative to the root of the module". I will change it to use the "coverage-srcDirs" property as the module source root.
Added value of "coverage-srcDirs" property to each path in the covera…
…ge.xml file; closes #322.