Quite hard to say what you are doing wrong based on just excerpt of pom.xml
In https://github.com/jacoco/jacoco/issues/476#issuecomment-271118961 that 
discusses similar issue, you can find example of JaCoCo usage with AspectJ 
Compile-Time Weaving.

On Wednesday, January 4, 2017 at 4:39:26 PM UTC+1, 
[email protected] wrote:
>
> On Tuesday, January 3, 2017 at 9:15:25 PM UTC+5:30, [email protected] 
> wrote:
> > can someone please check , where i am doing wrong?
>
> I was able to make it work but i am facing one problem and i am sure i am 
> pretty close but not finding what i need to do:
> Here is my pom.xml:
> <profile>
>             <id>int-coverage</id>
>             <activation>
>                 <property>
>                     <name>fitnese</name>
>                     <value>true</value>
>                 </property>
>             </activation>
>             <properties>
>                 <!-- Fitnesse run properties -->
>                 <fitnesse.port>9997</fitnesse.port>
>                 <fitnesse.suitename>FitNesse.Tests</fitnesse.suitename>
>                 
> <fitnesse.suitename.filter>smoke</fitnesse.suitename.filter>
>                 
> <jacoco.outputDir>${project.build.directory}</jacoco.outputDir>
>                 
> <jacoco.it.execution.data.file>${project.build.directory}/../coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
>
>                 <!-- Only unit tests are run by default. -->
>                 <skip.unit.tests>false</skip.unit.tests>
>                 <skip.integration.tests>false</skip.integration.tests>
>
>                 
> <ignore.unit.tests.failure>false</ignore.unit.tests.failure>
>                 
> <ignore.integration.tests.failure>false</ignore.integration.tests.failure>
>
>                 <ignore.rmp.build>false</ignore.rmp.build>
>                 <!-- The Cargo container type -->
>                 <cargo.container.id>tomcat7x</cargo.container.id>
>                 <!-- The URL of the Zip file based installer for the 
> container that Cargo is to deploy -->
>                 <cargo.container.url>
> http://nexus/content/repositories/public/org/apache/tomcat/apache-tomcat/7.0.55/apache-tomcat-7.0.55.zip
> </cargo.container.url>
>                 <!-- The location where downloaded container Zip file 
> installers are cached -->
>                 
> <cargo.container.download.dir>${user.home}/.m2/cargo/containers</cargo.container.download.dir>
>                 <!-- The port used by the forked container -->
>                 <cargo.container.port>8085</cargo.container.port>
>                 <!-- When using Tomcat, the AJP connector listen port -->
>                 
> <cargo.container.tomcat.ajp.port>5008</cargo.container.tomcat.ajp.port>
>                 <!-- The RMI port used on the container.  For Tomcat, this 
> is the value of the /Server/@port attribute. -->
>                 <cargo.container.rmi.port>8206</cargo.container.rmi.port>
>                 <!-- Optional JVM arguments for the forked container that 
> are prepended to the option
>                      that configures the Zommons config location and 
> appended to any debugging
>                      configuration set by cargo.container.jvmargs.debug 
> (See cargo-debug profile.)-->
>                 
> <cargo.container.jvmargs>-javaagent:${user.settings}/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=intuit/git/new/master/test/target/../coverage-reports/jacoco-it.exec
>  
> -XX:MaxPermSize=1024M -Xmx10204m</cargo.container.jvmargs>
>                 <!-- The port to use when the debugger is enabled. -->
>                 
> <cargo.container.debug.port>8003</cargo.container.debug.port>
>                 <!-- The suspend setting to use when the debugger is 
> enabled. -->
>                 
> <cargo.container.debug.suspend>n</cargo.container.debug.suspend>
>                 <!-- The debug arguments used to enable debugging on the 
> forked JVM. -->
>                 <cargo.container.debug.jvmargs>-Xdebug 
> -Xrunjdwp:transport=dt_socket,server=y,suspend=${cargo.container.debug.suspend},address=${cargo.container.debug.port}
>  
> -Djava.compiler=NONE</cargo.container.debug.jvmargs>
>                 
> <cargo.container.jvmargs.debug></cargo.container.jvmargs.debug>
>             </properties>
>             <build>
>                 <plugins>
>                     <plugin>
>                         <groupId>uk.co.javahelp.fitnesse</groupId>
>                         
> <artifactId>fitnesse-launcher-maven-plugin</artifactId>
>                         <version>1.4.2</version>
>                         <executions>
>                             <execution>
>                                 <id>integration-test</id>
>                                 <phase>integration-test</phase>
>                                 <goals>
>                                     <goal>set-up</goal>
>                                     <goal>run-tests</goal>
>                                     <goal>tear-down</goal>
>                                 </goals>
>                             </execution>
>
>                         </executions>
>                         <configuration>
>                             <port>${fitnesse.port}</port>
>                             
> <workingDir>${project.basedir}/../../../</workingDir>
>                             <root>FitNesseRoot</root>
>                             
> <reportsDir>${project.build.directory}/reports</reportsDir>
>                             
> <resultsDir>${project.build.directory}/results</resultsDir>
>                             
> <summaryFile>${project.build.directory}/results/failsafe-summary.xml</summaryFile>
>                             <createSymLink>true</createSymLink>
>                             
> <excludeOptionalDependencies>false</excludeOptionalDependencies> <!-- 
> Deprecated -->
>                             
> <deletePluginsProperties>false</deletePluginsProperties> <!-- Note the 's' 
> in "plugins" -->
>                             
> <alwaysUnpackFitnesse>false</alwaysUnpackFitnesse>
>                             <failIfNoTests>false</failIfNoTests>
>                             <launches>
>                                 <launch>
>                                     <suite>${fitnesse.suitename}</suite>
>                                     
> <suiteFilter>${fitnesse.suitename.filter}</suiteFilter>
>                                 </launch>
>                             </launches>
>                         </configuration>
>                     </plugin>
>
>                     <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-failsafe-plugin</artifactId>
>                         <version>2.17</version>
>                         <configuration>
>                             <!--<argLine>${failsafeArgLine} -Xmx2048m 
> -XX:MaxPermSize=1024m</argLine>-->
>                             
> <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
>                             
> <redirectTestOutputToFile>true</redirectTestOutputToFile>
>                             <!--
>                                 Skips integration tests if the value of 
> skip.integration.tests property is true
>                             -->
>                             <skipTests>false</skipTests>
>                             <testFailureIgnore>false</testFailureIgnore>
>                             <systemPropertyVariables>
>                             
> <jacoco-agent.destfile>${jacoco.it.execution.data.file}</jacoco-agent.destfile>
>                             </systemPropertyVariables>
>                         </configuration>
>                         <executions>
>                             <execution>
>                                 <id>integration-test</id>
>                                 <goals>
>                                     <goal>integration-test</goal>
>                                     <goal>verify</goal>
>                                 </goals>
>                             </execution>
>                         </executions>
>                     </plugin>
>
>                     <plugin>
>                         <groupId>org.jacoco</groupId>
>                         <artifactId>jacoco-maven-plugin</artifactId>
>                         <version>${jacoco.version}</version>
>                         <configuration>
>                             <append>true</append>
>                         </configuration>
>                         <executions>
>                             <execution>
>                                 <id>instrument</id>
>                                 <!--<phase>compile</phase>-->
>                                 <goals>
>                                     <goal>instrument</goal>
>                                 </goals>
>                             </execution>
>
>                             <execution>
>                                 <id>pre-integration-test</id>
>                                 <phase>pre-integration-test</phase>
>                                 <goals>
>                                     <goal>prepare-agent</goal>
>                                 </goals>
>                                 <configuration>
>                                     
> <destFile>${jacoco.it.execution.data.file}</destFile>
>                                     
> <propertyName>jacoco-agent.destfile</propertyName>
>                                 </configuration>
>                             </execution>
>                             <execution>
>                             <id>default-restore-instrumented-classes</id>
>                             <phase>post-integration-test</phase>
>                             <goals>
>                             <goal>restore-instrumented-classes</goal>
>                             </goals>
>
>                             </execution>
>
>                             <execution>
>                                 <id>post-integration-test</id>
>                                 <phase>post-integration-test</phase>
>                                 <goals>
>                                     <goal>report-integration</goal>
>                                 </goals>
>                                 <configuration>
>                                     <skip>false</skip>
>                                     
> <dataFile>${jacoco.it.execution.data.file}</dataFile>
>                                     
> <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
>
>                                 </configuration>
>                             </execution>
>                         </executions>
>
>                     </plugin>
>
>
>                     <plugin>
>                         <groupId>org.codehaus.cargo</groupId>
>                         <artifactId>cargo-maven2-plugin</artifactId>
>                         <version>1.4.15</version>
>                         <configuration>
>                             <container>
>                                 <containerId>${cargo.container.id
> }</containerId>
>                                 <zipUrlInstaller>
>                                     <url>${cargo.container.url}</url>
>                                     
> <downloadDir>${cargo.container.download.dir}</downloadDir>
>                                 </zipUrlInstaller>
>                                 
> <log>${project.build.directory}/cargo/logs/cargo.log</log>
>
>                                 
> <output>${project.build.directory}/cargo/logs/container.log</output>
>                                 <logLevel>debug</logLevel>
>                                 <timeout>3600000</timeout>
>                             </container>
>                             <configuration>
>                                 <properties>
>                                     <cargo.jvmargs>
>                                         ${cargo.container.jvmargs.debug}
>                                         ${cargo.container.jvmargs}
>                                     </cargo.jvmargs>
>                                     
> <cargo.servlet.port>${cargo.container.port}</cargo.servlet.port>
>                                     
> <cargo.tomcat.ajp.port>${cargo.container.tomcat.ajp.port}</cargo.tomcat.ajp.port>
>                                     
> <cargo.rmi.port>${cargo.container.rmi.port}</cargo.rmi.port>
>                                     <cargo.logging>high</cargo.logging>
>                                 </properties>
>                             </configuration>
>                             <deployables>
>                                 <deployable>
>                                     
> <location>${project.build.directory}/${project.version}.war</location>
>                                     <type>war</type>
>                                     <properties>
>                                         <context>/</context>
>                                     </properties>
>                                 </deployable>
>                             </deployables>
>                         </configuration>
>                         <executions>
>                             <execution>
>                                 <id>start-container</id>
>                                 <phase>pre-integration-test</phase>
>                                 <goals>
>                                     <goal>start</goal>
>                                 </goals>
>                             </execution>
>                             <execution>
>                                 <id>default-cli</id>
>                                 <goals>
>                                     <goal>run</goal>
>                                 </goals>
>                             </execution>
>                             <execution>
>                                 <id>stop-container</id>
>                                 <phase>post-integration-test</phase>
>                                 <goals>
>                                     <goal>stop</goal>
>                                 </goals>
>                             </execution>
>                         </executions>
>
>
>                     </plugin>
>
>
>                 </plugins>
>
>             </build>
>             <dependencies>
>                 <!-- Unit test code coverage with Sonar. -->
>                 <dependency>
>                     <groupId>org.jacoco</groupId>
>                     <artifactId>org.jacoco.agent</artifactId>
>                     <version>${jacoco.version}</version>
>                     <classifier>runtime</classifier>
>                     <scope>test</scope>
>                 </dependency>
>             </dependencies>
>         </profile>
>
> this gives me coverage of module 2 module but doesnot give me coverage of 
> module1 which is added as aspectj after binary waving is done.
>
> so if i do the instrument in compile phase before aspectj kicks in, it 
> does give me the coverage of aspectj module and if i do the instrument 
> after the aspectj compile , it gives me coverage of main module which i am 
> building and deploying and has depdendency of module 2 as aspectj.
>
> can you please tell me what i am doing wrong?
>
>

-- 
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/11ccdf2a-e0b2-489f-ae41-febfc63fede2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to