I believe this problem has something to do with a corrupted cobertura.ser file. I somehow got it to work, i.e. it was excluding the proper packages and classes. Since I had a number of exclude statements, I tried to isolate the exclude rules that were getting it to work. It just kept working until I took out all of the rules, then, of course nothing was excluded as expected. I then started putting rules back in until all were back but it still didn't work! I I figured there had to be some sort of caching optimization – something that was keeping track of the previous rules. I took a wild guess and blew away the cobertura.ser file in $
{basedir}
and it started working again! When it was bad, the cobertura.ser was 544K in size. When it was good, its size was only 164K.
I can only conclude that there is a bug here and that it has to do with what is written to the cobertura.ser file.
As a workaround, I would suggest blowing away your cobertura.ser file (noting the file's size) and then trying it again. It should work – take a note of the new file's size-- as long as your excludes are correct.
I am having the exact same issue. I cannot get Cobertura to exclude or ignore. The documentation is sparse and very poor for beginners. Can somebody get on this? My management is on my tail trying to get unwanted packages removed from the coverage reports.