Possibly the intent of my fix was not clear earlier, given the subject-line of this JIRA.
What I'd like to propose (and this is basically what Ryan Stewart had proposed earlier in this JIRA) is to leave the cobertura goal alone, and instead add support for a report-only goal. A similar "report-only" goal looks like was proposed in the
SUREFIRE-257 jira that you referenced for surefire
What I think people are wanting is just a way to not have the tests execute twice. It seems to be difficult to do that via the cobertura task or via some configuration in the surefire plugin. So what we'd like is just a basic report-only goal, which is already available in many other similar plugins.
Hence, if people wanted to just have run the tests once, they would access individual goals, similar to Ryan Stewart's proposal, i.e. 1) call the instrument goal 2) have the surefire plugin point to the instrumented folder 3) call the report-only goal to generate the report.
The reportOnlyAndInstrumentOutputDirPatch.patch has a patch for the report-only goal, as well as a configuration in the instrument goal to not switch the output folder, as otherwise having access to the instrument goal itself causes more trouble than we needed (as only the surefire plugin really needs the instrumented classes - all other plugins like code analysis [say findbugs] and jar/packaging need the actual classes).
This should be a reasonable compromise where 1) all behaviors for existing goals and configurations remain as is, including the cobertura task 2) people can still have better access to specific goals to handle executions the way that they want, if they choose that route. Short of having a better integration between surefire and cobertura, this seems like a best way to go, and would solve problems