jeudi 2 juillet 2015

System properties configured by failsafe are undefined when tests are run by cobertura

I'm using maven-failsafe-plugin 2.18.1 and cobertura-maven-plugin 2.7 in my Maven project. I have a maven property

<properties>
    <catalina.home>${project.build.directory}</catalina.home>
</properties>

Which is used as a system property by failsafe

<configuration>     
    <systemPropertyVariables>
        <catalina.home>@{catalina.home}</catalina.home>
    </systemPropertyVariables>
</configuration>

When I run my integration tests using mvn integration-test this property is picked up with no problem.

I also have cobertura configured

<reporting>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <check>true</check>
                <formats>
                    <format>html</format>
                    <format>xml</format>
                </formats>
            </configuration>
        </plugin>
    </plugins>
</reporting>

But when it runs the integration tests using mvn site the system property is not set. I think this must be a bug in the cobertura plugin but I was hoping there is a workaround someone might be able to suggest.

Aucun commentaire:

Enregistrer un commentaire