I also write it as a memorandum for myself. I'm still new to SE and inexperienced in technology and knowledge, so there may be some mistakes. If there is something wrong, I would appreciate it if you could point it out. And if possible, be gentle. ..
・ Windows10 64bit ・ Java7 -Eclipse Version: Luna Service Release 2 (4.4.2) The following plugins are installed ・ Junit ver 4.12 ・ Maven 4.0.0 ・ EclEmma 2.3.3 ・ Hudson / Jenkins 1.4.0
-Add the following statement to the pom.xml file
<!-- jacoco -->
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<scope>test</scope>
</dependency>
-First, add the maven installation path to the system environment variables
Example) Variable name: M2_HOME Path: D: \ apache-maven-3.3.9
-Add the following to the Path of the system environment %M2_HOME%\bin;
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dtest=Test.java
mvn org.jacoco:jacoco-maven-plugin:report
Supplement
-Dtest is an option when you want to execute a specific class
Output a coverage report with report.
The html file of the report is output to target / site / jacoco / index.html in the executed directory.
The org.jacoco part of org.jacoco: jacoco-maven-plugin: prepare-agent is in
No plugin found for prefix 'jacoco' in the current project and in the plugin groups
↑ If you get this error, please change it.
http://qiita.com/umezo@github/items/e750d8e94663f36d9500 https://ishiis.net/2016/10/13/jacoco-coverage/ http://d.hatena.ne.jp/yamap_55/20140727/1406438741 http://wiki.tk2kpdn.com/use-maven-command/ http://d.hatena.ne.jp/joe-hs/20120414/1334388111 http://www.techscore.com/tech/Java/ApacheJakarta/Maven/3/
Recommended Posts