Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1731

Generated sources and forked instrumentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Medium
    • long term roadmap
    • 4.0.4
    • Maven plugin
    • None
    • Severity 2 - Major

    Description

      In our project, source gets generated through annotation processors (i.e "transparently" through maven-compiler-plugin).

      I have seen a couple of bug reports regarding generated sources and Clover, but they all revolved around using the setup goal. I don't think that works in our case, since we want to run clover (incl. check) in "normal" builds.

      If I leave includesAllSourceRoots set to false, the compiler re-generates the code, but claims the classes are duplicate (presumably because both target/generated-sources/annotations/ and target/clover/generated-sources/annotations/ are in the source roots.

      If I set includesAllSourceRoots to true, I do see that the generated code gets instrumented (thus the .java source for these appear 3 times in target/), and the compiler still complains (it is not explicit about where the duplicates are, but i assume the compiler then uses target/clover/src/ (instrumented) and target/generated-sources/annotations/ (generated before clover kicked in).

      I'm sorry if this duplicating other issues, or if there is an existing solution for this. I have found anything.

      I'll try to debug myself a bit further and see if I can come up with anything (maybe an IT), but I thought I'd report this, since you seem to be quite responsive here.

      Attachments

        1. CLOV-1731.zip
          10 kB
        2. clover-version-in-ITs.patch
          25 kB
        3. verify_includeAllSourceRoots_false
          166 kB
        4. verify_includeAllSourceRoots_true
          166 kB

        Activity

          People

            Unassigned Unassigned
            59be85ca750f Gregory Joseph
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: