|
Thanks Wim! It seems that I misunderstood this issue, at least the title is strongly misleading: the clover report is generated, only the aspectj source files are not included in the coverage report. Now as far as I understand it, this is not a Maven issue. Clover uses source code instrumentation for it's coverage analysis (http://cenqua.com/clover/doc/faq.html#instrumentation If you agree, I think this issue can be closed as 'won't fix', unless you have a way to make clover work with aspectJ that we could implement in Maven. FYI: The current 1.2-SNAPSHOT version of the m1 cobertura plugin has been updated to cobertura 1.7 which includes support for aspectj compiled classes. I checked that it works for your test project (with <preGoal name="cobertura:report"><attainGoal name="aspectj:compile"/></preGoal>), you need to install the snapshot from cvs though. I'm afraid you misunderstood, because when I run maven site, the clover report is not generated. I don't care currently if the aspectj sources are not included in the coverage, I just want to get the clover report on my normal java files. Ok, I think I got it now. Wim, I think I finally figured this one out: the reason why clover doesn't work after aspectj is that ant's iajc task is configured by default to compile aspect .aj and java sources. When the javac task runs afterwards, it sees an up-to-date .class file of the java source file and skips another compilation. But clover is configured to run only on javac-generated sources. So I think the solution is simply to tell aspectj to only compile .aj source files: setting maven.aspectj.src.argfilesOnly=true for your test project gives me the clover report. However, I don't know if this is a workable solution for you, also the argfilesOnly property does not seem to be documented on the properties page of the aspectj plugin, I will add that shortly. Small correction: the maven.aspectj.src.argfilesOnly option was only introduced in aspectj-plugin-4.0, which I just released a few minutes ago. ok, thanks for the info, I will try the new version. Does that mean that the java files that are part of the same project will not be adviced with the aspects if only the .aj files are compiled with the aspectj compiler? For that is no problem, but if that is the case, you should document it properly I guess. I'm afraid it does not work for me, since my aspects have a dependency on my java files, so I would need to compile them as a whole |
||||||||||||||||||||||||||||||||||||||||||||
I have attached a different testcase. It should compile without problems and it follows closely the best principles of Maven and the documentations of both AspectJ and Clover plugins. When I run "maven site", no clover report is generated. The test are being run twice and the compilation also happens twice.