Title: JavaAgent
# Adding a JavaAgent
Adding a java agent is done via a vm parameter as follows:
{panel}
java -javaagent:openejb-javaagent-3.0-beta-2.jar _\[other params...](other-params....html)
_
{panel}
{note:title=Need the JavaAgent?}
The java agent is only required if using OpenJPA as your persistence
provider or if using CMP.
{note}
## Maven2
In maven2 you can enable the javaagent for your tests by adding this to
your pom.xml file:
org.apache.maven.plugins
maven-surefire-plugin
pertest
-javaagent:${basedir}/target/openejb-javaagent-3.0-beta-2.jar
${basedir}/target
org.apache.maven.plugins
maven-dependency-plugin
copy
process-resources
copy
org.apache.openejb
openejb-javaagent
3.0-beta-2
${project.build.directory}