Adding a JavaAgent

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

Adding a JavaAgent

Adding a java agent is 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 you 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 -->
    <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>
                <version>4.6.0</version>
                <outputDirectory>${project.build.directory}</outputDirectory>
              </artifactItem>
            </artifactItems>
          </configuration>
        </execution>
      </executions>
    </plugin>

  </plugins>
</build>
时间: 2024-10-12 16:05:54

Adding a JavaAgent的相关文章

Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)

catalog 1. How to Add New Functions to MySQL 2. Features of the User-Defined Function Interface 3. User-Defined Function 4. UDF Argument Processing 5. UDF Return Values and Error Handling 6. UDF Compiling and Installing 7. Adding a New Native Functio

Adding an On/Off switch to your Raspberry Pi

http://www.raspberry-pi-geek.com/Archive/2013/01/Adding-an-On-Off-switch-to-your-Raspberry-Pi#article_f5 Which Switch? Aaron Shaw Pulling the plug on your Pi without an orderly shutdown can corrupt the SD card. Also, many users prefer a convenient sw

vue报错/ style-loader: Adds some css to the DOM by adding a &lt;style&gt; tag

1.1.1.   vue-cli搭建的项目引入.styl/css文件报错 http://blog.csdn.net/z852064121/article/details/72660327 / style-loader: Adds some css to the DOM by adding a <style> tag webpack.base.conf.js文件下的加上黄色区域就不报错了 可以参考如下文章,http://blog.csdn.net/z852064121/article/detai

zoj 2001 Adding Reversed Numbers

Adding Reversed Numbers Time Limit: 2 Seconds      Memory Limit: 65536 KB The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to

Adding a Timepicker to jQuery UI Datepicker

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="

Android开发中遇到的requestFeature() must be called before adding content异常

缘起 上一篇博文中讲到了几种实现全屏显示Activity内容的方法.然而实际在实现中发现了一些问题,在本篇博文中进行总结下.首先交代一下开发环境,本人使用的是Android Studio 1.5.1,因此使用Eclipse ADT开发或者低版本的SDK的时候可能不会碰到这个问题.首先看onCreate()方法中的实现代码: 1 @Override 2 protected void onCreate(Bundle savedInstanceState) { 3 super.onCreate(sav

android wear开发之:增加可穿戴设备功能到通知中 - Adding Wearable Features to Notifications

注:本文内容来自:https://developer.android.com/training/wearables/notifications/index.html 翻译水平有限,如有疏漏,欢迎批评指教. 译:山人 增加可穿戴设备功能到通知中 Adding Wearable Features to Notifications When an Android handheld (phone or tablet) and Android wearable are connected, the han

Qt5官方demo解析集17——Chapter 3: Adding Property Bindings

本系列所有文章可以在这里查看http://blog.csdn.net/cloud_castle/article/category/2123873 接上文Qt5官方demo解析集16--Chapter 2: Connecting to C++ Methods and Signals 在C++中我们通常将用户的交互与处理函数用信号槽绑定起来,比如窗口尺寸的变化,颜色的变化等,但在QML中,我们更多的使用属性绑定来完成这些功能.我们可以将这个属性值绑定到另一个对象或者本身的属性值上,这样当后者改变时,

MAHOUT_LOCAL is not set;adding HADOOP_CONF_DIR to classpath

Spring3与Hibernate4整合时出现了nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider. hibernate3的时候,用spring来控制sessionfactory用的可以是org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean,因为用的是hibernate4所以照猫画