[ 
http://jira.codehaus.org/browse/MCOBERTURA-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Feltham updated MCOBERTURA-61:
------------------------------------

    Attachment: cobertura-datafile.patch

I have developed a patch to the cobertura-maven-plugin that fixes the original 
problem, and works with the released Cobertura 1.8 (ie. it does NOT require a 
patched Cobertura).

The trick is that the plugin needs to configure the Maven Surefire plugin's 
"systemProperties" property.

As a workaround for anyone that doesn't want to patch anything, the following 
snippet in your POM will get Cobertura working properly with the standard 
released versions of everything:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>net.sourceforge.cobertura.datafile</name>
                            
<value>${project.build.directory}/cobertura/cobertura.ser</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>

If you want to put this in the root pom of a multi-module project, the property 
expansion ${project.build.directory} doesn't seem to work so just replace it 
with "target".

> HTML report shows all 100% but cobertura:check shows correct coverage - only 
> in 2.1, works in 2.0
> -------------------------------------------------------------------------------------------------
>
>                 Key: MCOBERTURA-61
>                 URL: http://jira.codehaus.org/browse/MCOBERTURA-61
>             Project: Maven 2.x Cobertura Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: java 1.5.2_10, maven 2.0.4, windows XP SP2
>            Reporter: James Burton
>         Attachments: cobertura-datafile.patch
>
>
> The cobertura HTML report shows everything 100%, yet the cobertura:check goal 
> shows correct percentages complains about very low coverage, which is 
> correct. 
> The HTML report is correct when I use your plugin version 2.0, and this error 
> only shows up in 2.1.
> Here are my dependencies, from the Maven site generator...
> asm   asm-all 2.2.3   -       jar     
> aspectj       aspectjrt       1.5.2a  -       jar     
> aspectj       aspectjweaver   1.5.2a  -       jar     
> cglib cglib-nodep     2.1_3   -       jar     
> commons-dbcp  commons-dbcp    1.2     -       jar     
> commons-lang  commons-lang    2.2     -       jar     
> freemarker    freemarker      2.3.8   -       jar     
> ibatis        ibatis  2.3.0   -       jar     
> net.sourceforge.jtds  jtds    1.2     -       jar     
> org.codehaus.xfire    xfire-java5     1.2.4   -       jar     
> org.codehaus.xfire    xfire-jaxb2     1.2.4   -       jar     
> org.codehaus.xfire    xfire-spring    1.2.4   -       jar     
> org.springframework   spring  2.0.1   -       jar     
> org.springframework   spring-mock     2.0.1   -       jar     
> quartz        quartz  1.5.2   -       jar     
> taglibs       standard        1.1.2   -       jar     

-- 
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

Reply via email to