I've developed a java annotation processor (here is a good tutorial). I would like to get code coverage of the generated source code and have had no luck. I use maven as the build tool. Note that the class names of the generated source files contain '$$' to minimize the chance of class name collision (e.g., my/package/Foo$$Bar.java). The root of the source tree is target/generated-test-sources/test-annotations (maven's standard location for sources generated during a test compile).
How do I configure the clover maven plugin such that clover2:setup instruments these generated sources?
When using Clover with any code source generation user must ensure code generation happens before Clover instrumentation happens.
With code annotation processors this is a tricky part because those are processed in-the-fly by Java compiler.
What you may want to experiment with is to process the annotations via some plugin, make sure it's invoked before Clover.
Out of curiosity, why do you want to track coverage for a generated code? Usually it's a boilerplate code without any valid business logic in it.
Back in April of last year one of the major product announcements from Opsgenie was the launch of the Incident investigation view which created a deep connection between Bitbucket and Opsgenie, empow...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events