Maven real-Test coverage plug-in use

Source: Internet
Author: User

Original: http://www.cnblogs.com/yucongblog/p/5297051.html

1. Environmental preparedness
<Project>    ...    <Reporting>        <Plugins>            <plugin>                <groupId>Org.codehaus.mojo</groupId>                <Artifactid>Cobertura-maven-plugin</Artifactid>                <version>2.5.1</version>            </plugin>        </Plugins>    </Reporting>    ...</Project>

2. Check if the environment is successful

First Run "MVN cobertura:help" and if not, add the following warehouse

<Project>    ...    <pluginrepositories>        <pluginrepository>            <ID>Codehaus Repository</ID>            <URL>http://repository.codehaus.org/</URL>        </pluginrepository>    </pluginrepositories>    ...</Project>

3. Perform coverage statistics

Run MVN Coberura:coberura

If the operation is successful, see {project}\target\site\coberura\index.html

Such as

4.coberura Common Commands

Here is the command for the Cobertura plugin

MVN cobertura:help          View Cobertura plug-in Help mvn cobertura:clean         emptying Cobertura plug-in Run results mvn         Cobertura:check Run Cobertura check task mvn cobertura:cobertura     run Cobertura check task and generate report, report generated in Target/site/cobertura directory Cobertura: Dump-datafile     Cobertura datafile Dump mojomvn cobertura:instrument instrument the    compiled classes

Maven real-Test coverage plug-in use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.