This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to configure cobertura to output datafile in maven

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am trying to run cobertura in maven so that it generates a file in a seperate location than target/cobertura/cobertura.ser. However, I find no way to configure cobertura. I tried this

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<dataFile>C:\\Salil\\Work\\cobertura-datafiles\\corbertura.ser</dataFile>
<outputDirectory>C:\\Salil\\Work\\cobertura-report</outputDirectory>
</configuration>
</plugin>

and also tried `mvn clean cobertura:cobertura -Dcobertura.datafile=C:\\Salil\\Work\\cobertura-datafiles\\corbertura.ser` and that doesn't work either. I have tried ${project.build.directory} instead of a fixed path too. Tried java 6 and 7 and maven 3.0.2 and 3.2. None of it worked. What worked was
`mvn clean cobertura:cobertura -Dnet.sourceforge.cobertura.datafile=C:\\Salil\\Work\\cobertura-datafiles\\corbertura.ser`
which generates the given file but also creates another file in the default directory target/cobertura. I looked at the source code of cobertura maven plugin and I can see it has the old style of @parameter annotation which is in javadocs. So is it even configurable. In the end what I am trying to do is run cobertura in a specific configuration and generate a cobertura.ser file and then again in a different configuration to update the cobertura.ser file and then generate a report. What is the best way to do this? Run cobertura on the command line? Run cobertura via the ant maven task? Any other ideas?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic