you can manually bind btrace instrumentation to 'test-compile' <phase> 
specified within exec-maven-plugin e.g.
<plugin>                <groupId>org.codehaus.mojo</groupId>                
<artifactId>exec-maven-plugin</artifactId>                
<version>1.1.1</version>                <executions>                    
<execution>                        <phase>test-compile</phase>                  
      <goals>                            <goal>exec</goal>                      
  </goals>                        <configuration>                            
<executable>${java.home}/bin/java</executable>                            
<arguments>                                <argument>-cp</argument>             
                   <classpath/>                                
<argument>com.sun.btrace.compiler.Compiler</argument>                           
     <argument>-d</argument>                                
<argument>${basedir}/target/classes/</argument>                                
<argument>${basedir}/src/main/resources/scripts/TraceScript.java</argument>     
                       </arguments>                        </configuration>     
               </execution>                </executions>            </plugin>
perhaps it is best if we can see how you are currently binding btrace 
instrumentation ?
Martin 
______________________________________________ 



> Subject: Re: Mojos that instrument classes
> To: [email protected]
> From: [email protected]
> Date: Thu, 15 Sep 2016 08:33:11 -0700
> 
> This is what I'm using right now, but I've found that my instrumentation 
> mojo won't run if someone does "mvn test" or "mvn test-compile". The 
> user has to explicitly ask maven to run it. For example, "mvn 
> test-compile coroutines:test-instrument".
> 
> Is there a way to automatically get my mojo to run whenever test or 
> test-compile is run?
> 
> On 9/15/2016 2:39 AM, Olivier Lamy wrote:
> > Hi
> > Process-classes sounds a good place in the lifecycle for this purpose
> >
> > HTH
> > Olivier
> >
> > On Thursday, 15 September 2016, offbynull-maven <
> > [email protected]> wrote:
> >
> >> What should the defaultPhase be for a Maven plugin that instruments
> >> classes? Should it be PROCESS_CLASSES / PROCESS_TEST_CLASSES, or should it
> >> be COMPILE / TEST_COMPILE?
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
                                          

Reply via email to