Test coverage plug-in Cobertura-maven-plugin

Source: Internet
Author: User

MAVEN's test coverage plug-in integration, first modify the project's Pom.xml file, add the Cobertura-maven-plugin plugin as follows:

1. Environmental preparedness?
12345678910111213 <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

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

?
123456 mvn cobertura:help          查看cobertura插件的帮助mvn cobertura:clean         清空cobertura插件运行结果mvn cobertura:check         运行cobertura的检查任务mvn cobertura:cobertura     运行cobertura的检查任务并生成报表,报表生成在target/site/cobertura目录下cobertura:dump-datafile     Cobertura Datafile Dump Mojomvn cobertura:instrument    Instrument the compiled classes

Test coverage plug-in Cobertura-maven-plugin

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.