From: filip d. <dra...@gm...> - 2010-09-16 09:27:15
|
Hello, I would like to use cobertura in our project but I have one problem with implementation, can you please help me? I'm trying to use cobertura on integration tests. We are using maven antrun plugin for building our project. I'm using this profile: <profile> <id>cobertura</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <dependencies> <dependency> <groupId>net.sourceforge.cobertura</groupId> <artifactId>cobertura</artifactId> <version>1.9.4.1</version> <scope>test</scope> </dependency> </dependencies> <executions> <execution> <id>cobertura-instrument</id> <phase>pre-integration-test</phase> <configuration> <tasks> <mkdir dir="target/cobertura" /> <taskdef classpathref="maven.runtime.classpath" resource="tasks.properties" /> <cobertura-instrument dataFile="target/cobertura/cobertura.ser"> <fileset dir="target/classes"> <include name="**/*.class"/> </fileset> </cobertura-instrument> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> <execution> <id>cobertura-report</id> <phase>post-integration-test</phase> <configuration> <tasks> <taskdef classpathref="maven.runtime.classpath" resource="tasks.properties" /> <mkdir dir="target/cobertura" /> <mkdir dir="target/site/cobertura" /> <cobertura-report format="html" dataFile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura" srcdir="${basedir}/src/main/java"> </cobertura-report> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> No exception is thrown, instrumentation and reporting ended successfully the cobertura.ser file is created but it is not updated by the running tests. The report task than reports 0% of coverage on all classes. I have updated cobertura maven plugin so that it instruments the same classes and reporting works for integration tests but I can not use that plugin until it is possible with official version of that plugin. Can you please help me? I can not find the error in the ant script. Thank You Filip Drabek |