jacoco的maven外掛程式使用

來源:互聯網
上載者:User

最近要把java中的程式碼涵蓋範圍搞起來,開始使用的是emma,百度了好久沒有搞定,然後換成jacoco。其中收集了一些資料:

eclipse的eclemma外掛程式,使用的jacoco, 搞起來最輕鬆

http://www.eclemma.org/ 


emma的maven外掛程式:

http://www.cnblogs.com/morebetter/archive/2013/06/26/3156756.html


jacoco的maven外掛程式:

http://blog.csdn.net/wangmuming/article/details/28868833

http://www.cnblogs.com/D-Key/p/4530876.html  ----想迅速用起來,這篇blog足夠


emma好久不更新了,在配置的過程中,總是遇到:   Illegal local variable table start_pc 6 in method , 貌似是jdk版本高了。。。 然後放棄了。

改用jacoco,配置如下

pom.xml中添加:摘自http://www.cnblogs.com/D-Key/p/4530876.html

[html]  view plain  copy <span style="font-size:18px;"><build>           <plugins>               <!-- jacoco plugin -->               <plugin>                   <groupId>org.jacoco</groupId>                   <artifactId>jacoco-maven-plugin</artifactId>                   <version>0.7.9</version>                   <executions>                       <execution>                           <!-- 在maven的initialize階段,將Jacoco的runtime agent作為VM的一個參數 傳給被測程式,用於監控JVM中的調用。 -->                           <id>default-prepare-agent</id>                           <goals>                               <goal>prepare-agent</goal>                           </goals>                                 <configuration>                               <destFile>                                   ${project.build.directory}/coverage-reports/jacoco.exec                               </destFile>                               <propertyName>surefireArgLine</propertyName>                           </configuration>                             </execution

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.