Github user jdanekrh commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1380#discussion_r128558584
--- Diff: pom.xml ---
@@ -948,6 +966,169 @@
<skipTests>true</skipTests>
</properties>
</profile>
+ <!-- This profile generates jacoco coverage files. To generate html
report use "-Pjacoco-generate-report" -->
+ <profile>
+ <id>jacoco</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.jacoco</groupId>
+ <artifactId>org.jacoco.core</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jacoco-prepare</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+
<destFile>${project.build.directory}/jacoco.exec</destFile>
+ <!-- Jacoco sets this property with agent
configuration.
+ This property is passed to
maven-surefire-plugin -->
+ <propertyName>jacoco.agent</propertyName>
+ </configuration>
+ </execution>
+ <execution>
+ <id>merge</id>
+ <phase>none</phase>
+ <goals>
+ <goal>merge</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <fileSets>
+ <fileSet
implementation="org.apache.maven.shared.model.fileset.FileSet">
+ <directory>${activemq.basedir}</directory>
+ <includes>
+ <include>**/*.exec</include>
--- End diff --
> So it generates separate report for each module with tests.
It generates report for all module's dependencies together. So, if you run
it in module that does not have any sources of its own, and it depends on all
other modules in the project, there is only the dependencies report, which ends
up being report for your whole project.
See for yourself:
```
$ git clone [email protected]:jacoco/jacoco.git
$ cd jacoco
$ mvn verify
$ firefox org.jacoco.doc/target/site/jacoco-aggregate/index.html
```
> Element Missed Instructions Cov.
> org.jacoco.examples 411563 57%
> org.jacoco.agent.rt 187966 83%
> jacoco-maven-plugin 1741,680 90%
> ...
> Total 1,002 of 23,389 95%
(I noticed that the Jacoco project is using some ant magic too, so it looks
even using this target does not get rid of all ant.)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---