Hi, you cannot merge different versions of a class file. Class files have to be the exact same at runtime and at report time.
If you generate the report the second time only coverage for the new version (which haven't been executed) is shown. When you open the "Sessions" link on the top right corner of the report you will probably see both versions of the filenameX class. Documentation gives background information about class file identity in JaCoCo: https://www.jacoco.org/jacoco/trunk/doc/classids.html Regards, -marc On 2019-10-09 10:57, [email protected] wrote: > 1. I have one project (name: ProjectA) which includes some java file (for > example: filenameX.java) > 2. I use maven to build it to generage jar package > 3. I use the follow command to start this server: > java > -javaagent:/data/jacoco-0.8.4/lib/jacocoagent.jar=includes=*,output=tcpserver,port=2014,address=127.0.0.1 > -jar target/ProjectA-1.0.0-SNAPSHOT.jar > 4. I use curl to call the server, filenameX.java is called > 5. I use `dump` to get jacoco.exec file > 6. I use `report` to generate coverage: > total coverage: 22%, filenameX.java coverage: 12% > > Then, I update filenameX.java and re-build and re-start server, > I again use `dump` to get jacoco.exec file > I use `merge` to merge old and new exec file > I use `report` to generate coverage: > total coverage: 8%, filenameX.java coverage: 0% <= Why??? > > why? and how should I fix it? thanks! > > -- > You received this message because you are subscribed to the Google Groups > "JaCoCo and EclEmma Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/2ece211c-459b-4d1d-916b-87d0cb8fd55e%40googlegroups.com > [1]. Links: ------ [1] https://groups.google.com/d/msgid/jacoco/2ece211c-459b-4d1d-916b-87d0cb8fd55e%40googlegroups.com?utm_medium=email&utm_source=footer -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/c5f30564e7dddf5d6d86b455f13612a6%40mountainminds.com.
