Adding a javaagent

Source: Internet
Author: User

Copy from:http://tomee.apache.org/javaagent.html

Adding a javaagent

Adding A Java agent is the done via a VM parameter as follows:

java -javaagent:openejb-javaagent-4.6.0.jar _\[other params...](other-params....html)

: Title=need the Javaagent?} The Java agent is only required if using OpenJPA as your persistence provider or if using CMP.}

Maven2

In Maven2-can enable the javaagent for your tests by adding this to your Pom.xml file:

<build>  <plugins>    <!--This configures the surefire plugin to run your tests with the javaagent enabled- <plugin> <groupId>Org.apache.maven.plugins</groupId> <artifactId>Maven-surefire-plugin</artifactId> <configuration> <forkMode>Pertest</forkMode> <argLine>-javaagent:${project.basedir}/target/openejb-javaagent-4.6.0.jar</argLine> <workingDirectory>${project.basedir}/target</workingDirectory> </configuration> </plugin> <!--this tells Maven-to-copy the Openejb-javaagent jar into your target/directory- <!--where surefire can see it and <plugin> <groupId>Org.apache.maven.plugins</groupId> <artifactId>Maven-dependency-plugin</artifactId> <executions> <execution> <id>Copy</id> <phase>Process-resources</phase> <goals> <goal>Copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>Org.apache.openejb</groupId> <artifactid>openejb-javaagent</artifactid>< Span class= "PLN" > <version>4.6.0</version>< Span class= "PLN" > <outputdirectory>${project.build.directory} </outputdirectory> </artifactitem>  </artifactitems> </ Configuration> </execution>  </executions> </plugin> < /plugins></BUILD>        

Adding a javaagent

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.