<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Jacoco in Maven Build</title><link>https://answers.axonivy.com/questions/4312/jacoco-in-maven-build</link><description>&lt;p&gt;Hello,
I have been trying to get Jacoco to work with the maven build, because we used sonarqube to as part of our process and we need code coverage metrics. However, no matter what I do, Jacoco is always analyzing zero classes.&lt;/p&gt;
&lt;p&gt;Is there anything we can do for this?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/4312/jacoco-in-maven-build" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 13 Jan 2020 10:07:53 -0500</lastBuildDate><item><title>Answer by TareqK</title><link>https://answers.axonivy.com/questions/4312/jacoco-in-maven-build/4317</link><description>&lt;p&gt;Updates on this : &lt;/p&gt;
&lt;p&gt;Got it to work, turns out as &lt;a href="https://answers.axonivy.com/users/17/reguel-wermelinger"&gt;&lt;a href="https://answers.axonivy.com/users/17/reguel-wermelinger"&gt;@Reguel&lt;/a&gt;&lt;/a&gt; said, the JDT compiler wont play with a javaagent. I got around this by using the offline mode of jacoco, and copying the generated classes from the classes directory in the correct target/classes and target/test-classes directories . This is what the pom section looks like : &lt;/p&gt;
&lt;p&gt;&lt;a href="https://gist.githubusercontent.com/TareqK/3fbbd05c9a61116083872f9497a4e7a8/raw/528696c54214b546f5fc2541a83dfdf7b45a8d94/Jacoco%2520With%2520Axon%2520Ivy"&gt;Gist Of pom.xml parts&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You also need to set the &amp;lt;testoutputdirectory&amp;gt; as well, otherwise it wont work&lt;/p&gt;
&lt;p&gt;The reports are generated in the target/site/jacoco folder, and the jacoco.exec file is in the target folder as well&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">TareqK</dc:creator><pubDate>Mon, 13 Jan 2020 10:07:53 -0500</pubDate><guid>https://answers.axonivy.com/questions/4312/jacoco-in-maven-build/4317</guid></item></channel></rss>