【问题标题】:How to enable usage of Flight Recorder in Surefire plugin如何在 Surefire 插件中启用飞行记录器
【发布时间】:2020-12-17 11:32:45
【问题描述】:

我在 pom.xml 中为surefire插件添加了以下属性,但它仍然存在以下错误

<argLine>-XX:MaxPermSize=512m</argLine>
<argLine>-XX:+UnlockCommercialFeatures</argLine>
<argLine>-XX:+FlightRecorder</argLine>

错误:要使用 Flight Record 先解锁 UnlockCommercialFeatures。

任何关于示例 pom.xml 配置的建议 我的观察是,当我运行 Maven 构建时,主线程启用了此功能,但没有为surefire pluin 创建的 fork 线程启用此功能

【问题讨论】:

    标签: maven-surefire-plugin


    【解决方案1】:

    您不能重复使用argLine。您需要使用类似于

    的东西
    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <argLine>@{argLine} -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=1000s,filename=surefire.jfr</argLine>
      </configuration>
    </plugin>
    

    相反。类似的设置适用于故障保护。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-25
      • 1970-01-01
      • 1970-01-01
      • 2018-05-26
      • 2015-12-19
      相关资源
      最近更新 更多