Hi,

In our project we use offline instrumentation as we are doing AspectJ 
compile-time weaving. The report generated by the Maven report goal is accurate 
(although we use PowerMockito), but it is currently generated from the Maven 
default lifecycle, not the site lifecycle:
        <profile>
            <id>jacoco-coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <!-- our excludes -->
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>offline-instrument</id>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>restore-classes</id>
                                <goals>
                                    <goal>restore-instrumented-classes</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


Now, when I invoke mvn clean install site -P jacoco-coverage, this of course 
leads to the JaCoCo report not being shown under Project Reports. 
On the other hand, adding

  <reporting>
      <plugins>
          <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
      </plugins>
  </reporting>

leads to JaCoCo attempting another instrumentation of the classes in the site 
rendering phase, which then fails.

Is there a way to tell the jacoco-maven-plugin to not perform a second report 
generation, if there is already a generated report in the build sequence, so 
that it only attaches it as site artifact?


Thank you!
Florian

-- 
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/82e705e3-1694-44ec-89f4-2fbdc42c5642%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to