On Thursday, October 10, 2013 at 8:13:21 PM UTC+5:30, Henrik Horneber wrote:
> Great! :)
> Hi
> 
> 
> 
> On Thu, Oct 10, 2013 at 3:52 PM, Nihar Kurapati <[email protected]> wrote:
> 
> 
> FYI
> I solved the issue without setting the java agent explicitly in surefire 
> <argLine> tag. i.e.
> 
> Previously I've my jacoco plugin embedded inside pluginManagement tag, when 
> moving it out of pluginManagement and keeping it inside plugins tag of maven 
> it worked as expected with 'propertyName' approach :)
> 
> 
> 
> So, here is how my working pom looks like
> <plugins>
> 
> 
>     <plugin>
>         <groupId>org.jacoco</groupId>
>         <artifactId>jacoco-maven-plugin</artifactId>
> 
>               <version>${jaCoCoVersion}</version>
>               <configuration>
>                 <dataFile>${jaCoCoExecutionDataFile}</dataFile>
> 
>         </configuration>
> 
>         <executions>
>             <execution>
>                 <id>jacoco-initialize</id>
> 
>                    <phase>initialize</phase>
>                     <goals>
>                           <goal>prepare-agent</goal>
> 
>                         </goals>
>                         <configuration>
> 
>                                     
> <propertyName>jacoco.agent.argLine</propertyName>
>                                     
> <destFile>${jaCoCoExecutionDataFile}</destFile>
> 
>                         </configuration>
>                       </execution>
>                       <execution>
> 
>                         <id>jacoco-report</id>
> 
>                         <phase>verify</phase>
> 
>                         <goals>
>                           <goal>report</goal>
>                         </goals>
> 
>                   </execution>                        
>               </executions>
> 
>       </plugin>
> </plugins>
> <pluginManagement>
>     <plugins>
> 
>         <plugin>          
>           <groupId>org.apache.maven.plugins</groupId>
> 
>           <artifactId>maven-surefire-plugin</artifactId>
>           <version>2.16</version>
>           <dependencies>
>             <dependency>
> 
>               <groupId>org.apache.maven.surefire</groupId>
>               <artifactId>surefire-junit47</artifactId>
>               <version>2.16</version>
>             </dependency>
> 
>           </dependencies>
>           <configuration>            
>               <argLine>${jacoco.agent.argLine}</argLine>
>           </configuration>
> 
>         </plugin>
>       </plugins>
> </pluginManagement>
> Thanks a lot for your help. 
> 
> 
> 
> 
> On Tuesday, October 8, 2013 11:10:25 AM UTC-4, Nihar Kurapati wrote:
> 
> Hi,
> 
> 
> Sorry for late reply. I've tried with propertyName also, still doesn't work. 
> It only works when I explicitly mention java agent, and with this 
> configuration rules doesn't seem like working.
> 
> 
> 
> Appreciate your help.
> 
> 
> Thanks,
> Nihar
> 
> On Saturday, October 5, 2013 2:21:47 AM UTC-4, Henrik Horneber wrote:
> 
> 
> 
> 
> Hi,
> 
> as I am not at work right not I can' tell for certain, but I'm pretty sure 
> that your pom is exactly what my working ones look like, except for the 
> argLine property.
> 
> 
> 
> Like this:
> 
> 
> <plugin>
>               <groupId>org.jacoco</groupId>
>               <artifactId>jacoco-maven-plugin</artifactId>
> 
> 
>               <version>0.6.3.201306030806</version>
>          <executions>
> 
>               <execution>
>                       <id>jacoco-initialize</id>
>                       <phase>initialize</phase>
> 
> 
>                       <goals>
>                               <goal>prepare-agent</goal>
>                       </goals>
> 
> 
>               </execution>
>               <execution>
>                   <id>jacoco-site</id>
> 
> 
>                   <phase>verify</phase>
>                   <goals>
>                         <goal>report</goal>
> 
> 
>                   </goals>
>               </execution>
>       </executions>
> 
> 
> </plugin>
> 
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-surefire-plugin</artifactId>
> 
>       <version>2.16</version>
> 
>       <dependencies>
>           <dependency>
>               <groupId>org.apache.maven.surefire</groupId>
>               <artifactId>surefire-junit47</artifactId>
> 
> 
>               <version>2.16</version>
>           </dependency>
>       </dependencies>
>       <configuration>
> 
> <!--- CHANGED HERE from what you sent -->
> 
> 
> 
>           <argLine>-Xmx1024M ${argLine}</argLine>
>       </configuration>
> </plugin>
> 
> 
> ... but you already tried that, since this is what Marc suggested, right?
> 
> 
> 
> 
> Someone else recently sent an example on how to configure jacoco so it does 
> not set argLine but a different property, using propertyName.
> 
> Ah, here https://groups.google.com/forum/#!topic/jacoco/09if-cdReGQ.
> 
> 
> 
> 
> Might be worth another shot. 
> 
> 
> 
> 
> On Thu, Oct 3, 2013 at 9:46 PM, Nihar Kurapati <[email protected]> wrote:
> 
> 
> Hi,
> 
> 
> It generates jacoco.exec file when I specify the java agent explicitly in 
> surefire's <argLine> attribute, please see below
> 
> 
> 
> 
> 
> 
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-surefire-plugin</artifactId>
> 
> 
>       <version>2.16</version>
>       <dependencies>
>           <dependency>
> 
>               <groupId>org.apache.maven.surefire</groupId>
> 
>               <artifactId>surefire-junit47</artifactId>
>               <version>2.16</version>
>           </dependency>
> 
> 
>       </dependencies>
>       <configuration>
>           
> <argLine>-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/0.6.3.201306030806/org.jacoco.agent-0.6.3.201306030806-runtime.jar=destfile=${project.build.directory}\jacoco.exec</argLine>
> 
> 
>       </configuration>
> </plugin>
> 
> 
> It seems like my problem is similar to the one posted in 
> https://groups.google.com/forum/#!msg/jenkins-jacoco-plugin-mailing-list/4SwvdUwLNAg/ZzCrqQAD0nsJ.
>  So, there is no other way to fix this problem?
> 
> 
> 
> 
> In my case I'm  using GwtMockito (Mocking framework), not sure whether the 
> above post applies to all mocking frameworks.
> 
> 
> Please help me out. Appreciate your help.
> 
> 
> 
> 
> Thanks,
> Nihar
> 
> 
> On Thursday, October 3, 2013 3:12:39 PM UTC-4, Nihar Kurapati wrote:
> 
> 
> Here is how my complete pom looks like.
> 
> 
> 
> <plugin>
>               <groupId>org.jacoco</groupId>
>               <artifactId>jacoco-maven-plugin</artifactId>
> 
> 
>               <version>0.6.3.201306030806</version>
>          <executions>
> 
>               <execution>
>                       <id>jacoco-initialize</id>
>                       <phase>initialize</phase>
> 
> 
>                       <goals>
>                               <goal>prepare-agent</goal>
>                       </goals>
> 
> 
>               </execution>
>               <execution>
>                   <id>jacoco-site</id>
> 
> 
>                   <phase>verify</phase>
>                   <goals>
>                         <goal>report</goal>
> 
> 
>                   </goals>
>               </execution>
>       </executions>
> 
> 
> </plugin>
> 
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-surefire-plugin</artifactId>
> 
>       <version>2.16</version>
> 
>       <dependencies>
>           <dependency>
>               <groupId>org.apache.maven.surefire</groupId>
>               <artifactId>surefire-junit47</artifactId>
> 
> 
>               <version>2.16</version>
>           </dependency>
>       </dependencies>
>       <configuration>
>           <argLine>-Xmx1024M</argLine>
> 
> 
>       </configuration>
> </plugin>
> 
> 
> Thanks for your help.
> On Thursday, October 3, 2013 2:59:53 PM UTC-4, Henrik Horneber wrote:
> 
> 
> It gets set by jacoco. Your first mail contained the actual line.
> 
> It's hard to tell what is going on without seeing the complete pom. 
> 
> 
> 
> Am 03.10.2013 18:15 schrieb "Nihar Kurapati" <[email protected]>:
> 
> 
> 
> 
> I don't think it is set before test execution. what it should be set to?
> 
> 
> Thanks,
> Nihar
> 
> On Thursday, October 3, 2013 12:05:06 PM UTC-4, Marc R. Hoffmann wrote:
> 
> 
> This is strange. If you check the build log: Has the argLine property 
> 
> been set *before* the test execution?
> 
> 
> 
> Cheers,
> 
> -marc
> 
> 
> 
> On 2013-10-03 17:23, Nihar Kurapati wrote:
> 
> > Thanks for your response Marc.
> 
> > I tried what you've suggested and it fails the build now with below
> 
> > error.
> 
> > 
> 
> > ERROR: COULD NOT FIND OR LOAD MAIN CLASS ${ARGLINE}
> 
> > 
> 
> > [ERROR] Failed to execute goal
> 
> > org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-tes
> 
> > t) on project <projectName>: Execution default-test of goal
> 
> > org.apache.maven.plugins:maven-surefire-plugin
> 
> > :2.16:test failed: The forked VM terminated without saying properly
> 
> > goodbye. VM crash or System.exit
> 
> >  called ?
> 
> > 
> 
> > Thanks,
> 
> > Nihar
> 
> > 
> 
> > On Thursday, October 3, 2013 10:54:24 AM UTC-4, Marc R. Hoffmann
> 
> > wrote:
> 
> > 
> 
> >> Hi Nihar,
> 
> >> 
> 
> >> so you're overwriting the argLine property again. Try this one:
> 
> >> 
> 
> >> <argLine>-Xmx1024M ${argLine}</argLine>
> 
> >> 
> 
> >> Cheers,
> 
> >> -marc
> 
> >> 
> 
> >> On 2013-10-03 14:54, Nihar Kurapati wrote:
> 
> >>> Hi,
> 
> >>> 
> 
> >>> Thanks for your quick response.
> 
> >>> I usually run unit tests using MVN TEST command.
> 
> >>> Please see below how is maven-surefire-plugin configured in
> 
> >> pom.xml
> 
> >>> 
> 
> >>> <plugin>
> 
> >>> <groupId>org.apache.maven.plugins</groupId>
> 
> >>> <artifactId>maven-surefire-plugin</artifactId>
> 
> >>> <version>2.16</version>
> 
> >>> <dependencies>
> 
> >>> <dependency>
> 
> >>> <groupId>org.apache.maven.surefire</groupId>
> 
> >>> <artifactId>surefire-junit47</artifactId>
> 
> >>> <version>2.16</version>
> 
> >>> </dependency>
> 
> >>> </dependencies>
> 
> >>> <configuration>
> 
> >>> <argLine>-Xmx1024M</argLine>
> 
> >>> </configuration>
> 
> >>> </plugin>
> 
> >>> 
> 
> >>> I'm not exactly sure, whether the tests run in the same VM or
> 
> >>> different VM. Please let me know how can I check that.
> 
> >>> 
> 
> >>> Thanks,
> 
> >>> Nihar
> 
> >>> On Thursday, October 3, 2013 3:17:15 AM UTC-4, Henrik Horneber
> 
> >> wrote:
> 
> >>> 
> 
> >>>> Hi,
> 
> >>>> 
> 
> >>>> how do you start / run your unit tests?
> 
> >>>> Do you have any configuration for maven-surefire-plugin, for
> 
> >>>> example something like <argLine>-XmX1024M</argLine>?
> 
> >>>> 
> 
> >>>> Do the tests run in the same VM you are attaching the jacoco
> 
> >> agent
> 
> >>>> to, or does the actual code run in a different VM?
> 
> >>>> 
> 
> >>>> regards,
> 
> >>>> Henrik
> 
> >>>> 
> 
> >>>> On Wed, Oct 2, 2013 at 10:18 PM, Nihar Kurapati
> 
> >> <[email protected]>
> 
> >>>> wrote:
> 
> >>>> 
> 
> >>>>> Hi,
> 
> >>>>> 
> 
> >>>>> I couldn't see any JACOCO.EXEC file generated in 'target' folder
> 
> >> 
> 
> >>>>> after running "MVN JACOCO:PREPARE-AGENT", but the build is
> 
> >> success
> 
> >>>>> and during the build process I see message like below
> 
> >>>>> "[INFO] ARGLINE SET TO
> 
> >>>>> -JAVAAGENT:E:WORKDIRUNITOUTREPOSITORYORGJACOCOORG.JACOCO
> 
> >>>>> 
> 
> >>>> 
> 
> >>> 
> 
> >> 
> 
> > .AGENT0.6.3.201306030806ORG.JACOCO.AGENT-0.6.3.201306030806-RUNTIME.JAR=DESTFILE=E:WORKDIRUNITSRC<PROJECT>SRC<PACKAGE>TARGETJACOCO.EXEC"
> 
> >> 
> 
> >>>>> 
> 
> >>>>> 
> 
> >>>>> But when I check at the location after the build is success, I
> 
> >>>>> don't see any .exec file in the specified location.
> 
> >>>>> 
> 
> >>>>> Please help me out on resolving this issue. For reference please
> 
> >> 
> 
> >>>>> see my pom.xml below and I'm using GWTMOCKITO for unit tests.
> 
> >>>>> 
> 
> >>>>> <plugin>
> 
> >>>>> <groupId>org.jacoco</groupId>
> 
> >>>>> <artifactId>jacoco-maven-plugin</artifactId>
> 
> >>>>> <version>0.6.3.201306030806</version>
> 
> >>>>> <executions>
> 
> >>>>> <execution>
> 
> >>>>> <id>jacoco-initialize</id>
> 
> >>>>> <phase>initialize</phase>
> 
> >>>>> <goals>
> 
> >>>>> <goal>prepare-agent</goal>
> 
> >>>>> </goals>
> 
> >>>>> </execution>
> 
> >>>>> <execution>
> 
> >>>>> <id>jacoco-site</id>
> 
> >>>>> <phase>verify</phase>
> 
> >>>>> <goals>
> 
> >>>>> <goal>report</goal>
> 
> >>>>> </goals>
> 
> >>>>> </execution>
> 
> >>>>> </executions>
> 
> >>>>> </plugin>
> 
> >>>>> 
> 
> >>>>> Thanks,
> 
> >>>>> Nihar
> 
> >>>>> 
> 
> >>>>> --
> 
> >>>>> 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].
> 
> >>>>> For more options, visit https://groups.google.com/groups/opt_out
> 
> >> [1]
> 
> >>>>> [1].
> 
> >>>> 
> 
> >>>> --
> 
> >>>> "I find many of the machines of violence very attractive. Tanks,
> 
> >>>> airplanes, warships, especially aircraft carriers."
> 
> >>>> - 14th Dalai Lama
> 
> >>> 
> 
> >>> --
> 
> >>> 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].
> 
> >>> For more options, visit https://groups.google.com/groups/opt_out
> 
> >> [1] [1].
> 
> >>> 
> 
> >>> 
> 
> >>> Links:
> 
> >>> ------
> 
> >>> [1] https://groups.google.com/groups/opt_out [1]
> 
> > 
> 
> >  --
> 
> >  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].
> 
> >  For more options, visit https://groups.google.com/groups/opt_out [1].
> 
> > 
> 
> > 
> 
> > Links:
> 
> > ------
> 
> > [1] https://groups.google.com/groups/opt_out
> 
> 
> 
> 
> 
> 
> -- 
> 
> 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].
> 
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> 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].
> 
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> "I find many of the machines of violence very attractive. Tanks, airplanes, 
> warships, especially aircraft carriers."
> - 14th Dalai Lama
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> 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].
> 
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> "I find many of the machines of violence very attractive. Tanks, airplanes, 
> warships, especially aircraft carriers."
> - 14th Dalai Lama

-- 
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/4acb7dcd-783b-4db1-a328-cc516aa20d30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to