【发布时间】:2016-12-14 18:18:49
【问题描述】:
我在尝试向 jvm 添加参数时遇到了困难。看起来使用surefire是做到这一点的唯一方法。我当前在 pom.xml 中的代码是
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<argLine>-Xmx512m</argLine>
<systemPropertyVariables>
<all.clusters>${all.clusters}</all.clusters>
<branding.token>${brandingToken}</branding.token>
</systemPropertyVariables>
</configuration>
</plugin>
Maven 对我来说是新的,所以也许我错过了一些简单的东西。
在 Netbeans 8.1 环境中运行。
【问题讨论】:
-
这个配置有什么问题?除了
version不正确之外,它看起来还可以。 -
它不起作用。根据我的日志记录,我收到以下消息。输入参数:-Xms24m -Xmx64m -XX:MaxPermSize=384m
-
当
maven-surefire-plugin被调用时,你能在调试模式(-X)下发布相关的Maven日志吗? -
不知道该怎么做。我在 netbeans 中运行,而不是从 cli 中运行。
-
看来仅仅在构建部分有万无一失是不够的。研究如何确保它运行。
标签: java maven netbeans surefire