# Trouble generating JaCoCo XML format

**URL:** <https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197>\
**Category:** SonarQube Server / Community Build\
**Tags:** jacoco\
**Created:** [November 9, 2020, 10:02am UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197 "2020-11-09T10:02:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Obuli\_Sankar](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/obuli_sankar/32/16756_2.png) [@Obuli\_Sankar](https://community.sonarsource.com/u/Obuli_Sankar)\
**Post date:** [November 9, 2020, 10:02am UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197/1 "2020-11-09T10:02:20Z")

</div>

I have similar issue. I am using jacoco version 0.8.6. On executing through mvn build, i get the following error “java.lang.IllegalStateException: Failed to parse JaCoCo XML report:”. The jacoco.xml file is getting generated, but it is in the same format as like jacoco.exec file. And hence the error says unable to parse the file.  
Looks like i am missing something to generate in the proper xml format. I have set the sonar.coverage.jacoco.xmlReportPaths as well. So could you please help me with property that i need to set for generating the report in xml format. I am using maven pom.xml file to build my application.

Here is my snapshot of error trace  
[ERROR] Coverage report ‘C:\Users…\target\coverage-reports\jacoco.xml’ could not be read/imported. Error: {}  
java.lang.IllegalStateException: Failed to parse JaCoCo XML report: C:\Users…\target\coverage-reports\jacoco.xml  
at org.sonar.plugins.jacoco.XmlReportParser.parse(XmlReportParser.java:96)  
at org.sonar.plugins.jacoco.JacocoSensor.importReport(JacocoSensor.java:73)  
at org.sonar.plugins.jacoco.JacocoSensor.importReports(JacocoSensor.java:64)

---

<div class="post-metadata">

**Author:** ![Jeff\_Zapotoczny](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeff_zapotoczny/32/2816_2.png) [@Jeff\_Zapotoczny](https://community.sonarsource.com/u/Jeff_Zapotoczny)\
**Post date:** [November 10, 2020, 9:21pm UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197/2 "2020-11-10T21:21:11Z")

</div>

Hi @Obuli_Sankar, welcome to the SonarSource Community!

We have a [guide dedicated to this topic](https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151). Please have a look there and follow the instructions carefully. It looks like you may not have adjusted your pom.xml properly to stop building the exec format and instead build the XML.

---

<div class="post-metadata">

**Author:** ![Vikrant\_Korde](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/vikrant_korde/32/27465_2.png) [@Vikrant\_Korde](https://community.sonarsource.com/u/Vikrant_Korde)\
**Post date:** [November 17, 2021, 12:18pm UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197/3 "2021-11-17T12:18:26Z")

</div>

We are stuck with the same error. I followed the steps mentioned on " [guide dedicated to this topic](https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151)" page. However the file generated is still not the correct XML format. We printed the jacoco.xml file in jenkins and found something as below (pasting only few lines)

��aca6191af5ae0-1a24a201}-�Sy}-ƌ|pW�\����;org/springframework/context/annotation/BeanAnnotationHelper�w~�j�zI�ZMorg/springframework/boot/autoconfigure/condition/FilteringSpringBootCondition!������e֢+org/springframework/cglib/core/ReflectUtils�|O���I�\>������e��o�1org/aspectj/weaver/patterns/AnnotationTypePattern.8l�+��S4com/fasterxml/jackson/annotation/JsonProperty$Accessa}o}ۿ"?�org/junit/runner/Description=I��|^�’)FHnet/bytebuddy/implementation/bytecode/member/MethodInvocation$Invocation-o��CD  
a��[�]org/springframework/context/annotation/ConfigurationClassParser$DeferredImportSelectorHandler�}"���W���Jorg/springframework/boot/context/properties/PropertyMapper$CachingSupplier�1���,i�Rorg/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping������������’IH\a\>\�����Wnet/bytebuddy/description/type/TypeDescription$Generic$AnnotationReader$ForTypeArgument�7���A�3org/springframework/cglib/core/DebuggingClassWriter� ��5�9�u!org/aspectj/weaver/RuntimeVersion�W���BH:org/springframework/beans/propertyeditors/PropertiesEditorV��\�Z\<Morg/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController)����D�=org/springframework/format/datetime/standard/InstantFormatter �M���\*v�0org/apache/logging/log4j/core/lookup/UpperLookup}�����:org/apache/logging/log4j/core/config/AbstractConfiguration����8w�’!���\<�q��}^�� \>3�\>0w�����}���rx��j~S

sW/com/fasterxml/jackson/databind/cfg/MapperConfig\>�wf�0Hr�K

---

<div class="post-metadata">

**Author:** ![babbarsurbhi9](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/babbarsurbhi9/32/33714_2.png) [@babbarsurbhi9](https://community.sonarsource.com/u/babbarsurbhi9)\
**Post date:** [May 26, 2022, 12:08pm UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197/4 "2022-05-26T12:08:46Z")

</div>

is your issue resolved? I am also facing the same. jacoco.xml file is generated but it is the binary format.

---

<div class="post-metadata">

**Author:** ![KARANAM\_GURUTEJA](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karanam_guruteja/32/43602_2.png) [@KARANAM\_GURUTEJA](https://community.sonarsource.com/u/KARANAM_GURUTEJA)\
**Post date:** [March 28, 2023, 2:40pm UTC](https://community.sonarsource.com/t/trouble-generating-jacoco-xml-format/34197/5 "2023-03-28T14:40:46Z")

</div>

Hi , I am exactly facing the same issue  
Is your issue got resolved? I have followed the steps mentioned in the guide but still it is not parsing properly.
