Why does Clover instrument classes I have excluded using the 'exclude' element of the 'clover-setup ' task?

Q: Why does Clover instrument classes I have excluded using the <exclude> element of the <clover-setup> task?There are two possible causes:

  1. Cascading build files:
    Clover uses Ant patternsets to manage the includes and excludes specified in the <clover-setup> task. By default Ant does not pass these patternsets to the sub-builds. If you are using
    a master-build/sub-build arrangement, with compilation occuring in the sub-builds and <clover-setup> done in the master-build, you will need to explicitly pass these patternsets as references:
    <ant ...>
    <reference refid="clover.files"/>
    <reference refid="clover.useclass.files"/>
    </ant>
    
  2. Excluded files are still registered in the Clover database:
    Clover's database is built incrementally, and this can mean that files that are now excluded but were previously included are still reported on. The simple workaround is to delete the Clover database whenever you change the Clover includes or excludes. This is fixed in Clover 1.2.