including source code in class directory causes 0% coverage on report without
warning or explaination
-----------------------------------------------------------------------------------------------------
Key: MCOBERTURA-89
URL: http://jira.codehaus.org/browse/MCOBERTURA-89
Project: Maven 2.x Cobertura Plugin
Issue Type: Improvement
Affects Versions: 2.2
Reporter: Randy Kamradt
I use an ant task in my pom to copy source files into the class directory for
inclusion in the jar file, for use by the GWT compiler. Previously, I had the
task execute in the compile stage, which was probably incorrect. The only
trouble it caused was that the cobertura reports for the source files copied in
all reported 0% code coverage, although the surefile report said all the tests
executed. I spent quite some time figuring out why some files always reported
0% in this project that is, for the most part, quite normal, when the coverage
in all other projects seemed dead on.
My work around was doing what I should have done in the first place, copy the
source files in the prepackage stage. It would be nice if there were some
warning or indication that coping in the source during the compile phase would
cause problems.
This is the plugin section that caused all the problems:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-source</id>
<phase>compile</phase>
<configuration>
<tasks>
<copy todir="target/classes">
<fileset dir="src/main/java">
<include name="**/Entity.gwt.xml" />
<include
name="**/validation/ValidationContext.java" />
<include name="**/validation/*CF.java" />
<include
name="**/validation/*Failure*.java" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email