The path to the data-file (by default named cobertura.ser) can be specified via the "datafile" arguments of the
'cobertura-instrument' and 'cobertura-report' tasks.
It is expected, that by providing a value for 'datafile' argument for both these tasks;
1. The cobertura.ser file will be initially written at the invokation of the 'cobertura-instrument' task
2. on running of the junit tests, the 'cobertura.ser' file will be updated with results
3. on running of the task 'cobertura-report' the same file will be used to generate the report
only 1 and 3 get done.
When the junit tests are running, unless you set the property : 'net.sourceforge.cobertura.datafile'
to the same location, the results are updated to yet another file at the working directory
(which is then not used for the generation of the report).
There is a fundamental inconsistency here. One of two things should be true here:
1. If they will not be used, there should be no 'datafile' argument to the cobertura tasks, only the property should be used, OR
2. the datafile argument setting should be respected, and take priority over any property set
To provide an argument to these tasks, and then ignore it for some of the functionality, and not others, is inconsistent, and confusing.