activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdanekrh <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1380: ARTEMIS-1265 JaCoCo profile for getting...
Date Thu, 20 Jul 2017 12:29:46 GMT
Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1380#discussion_r128500482
  
    --- 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 --
    
    afaik, the merge+ant thing is a workaround for . latest jacoco has `report-aggregate`
goal which should take care of it, http://www.eclemma.org/jacoco/trunk/doc/report-aggregate-mojo.html.
The way this tends to be used is that one selects a module which does not hold any code (something
with docs, or artemis-distribution, in our case, maybe) and makes it depend on all other modules
(to ensure that the coverage report is written only after .exec files were generated for all
modules). JaCoCo itself does it this way, https://github.com/jacoco/jacoco/blob/86856fef9959d90acdddc9d15c7b3c5f587fe086/org.jacoco.doc/pom.xml#L130.
    
    I do not know if it is any way better or worse than this solution. Just a thought.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message