You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by David Blevins <da...@visi.com> on 2008/08/20 08:25:56 UTC

Surefire support for a javaagent

Currently, it's a bit of a trick trying to get a javaagent in use with  
your test cases.  Here's the boiler plate pom text:
http://cwiki.apache.org/OPENEJBx30/javaagent-with-maven-surefire.html

It'd be really great if we could just do it like this:

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <forkMode>pertest</forkMode>
           <javaagent>
             <groupId>org.apache.openejb</groupId>
             <artifactId>openejb-javaagent</artifactId>
             <version>3.0</version>
             <options>the optional javaagent options string</options>
           </javaagent>
         </configuration>
       </plugin>

The plugin could get the path to the artifact in the local repo and  
prepend the string "-javaagent:<jarpath>[=<options>]" to the value of  
argLine if there is one, similar to how the classpath is created.   
Seems like we could just take part of the maven-dependency-plugin and  
reuse it in the surefire plugin.

I've hacked on some plugins before, but the surefire one seems a  
little more complicated than the typical plugin.  Anyone with some  
surefire expertise interested in working on this?

-David


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Surefire support for a javaagent

Posted by Dan Fabulich <da...@fabulich.com>.
David Blevins wrote:

> I've hacked on some plugins before, but the surefire one seems a little more 
> complicated than the typical plugin.  Anyone with some surefire expertise 
> interested in working on this?

This is filed as SUREFIRE-179.  It has an old patch, and no integration 
test.  The patch seems to have basically the right idea, though.

If you can fix up that patch and add an integration test, we can probably 
get it into the next version of Surefire.

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org