代理(squid)后面的 Maven 测试
我在鱿鱼代理服务器后面的 Maven 遇到问题。
我的系统有一个模块,它依赖于与远程 Web 服务的外部通信。
我的 Maven 代理配置位于 ~/.m2/settings.xml 下,但显然,这些信息仅用于依赖项下载。
当我运行“mvn test”时,这些配置不会在命令行执行调用中使用。这是控制台上回显的指令:
${JAVA_HOME}/bin/java -jar /tmp/surefirebooter4156656684210940660.jar /tmp/surefire2646147996861949548tmp /tmp/surefire3498083351425809633tmp
There’s a way to pass argument to JVM duringtests and other maven methodexecution?
I'm having a problem with Maven behind a squid proxy server.
I have a module of my system that depends external communication with a remote webservice.
I have my maven proxy configurations under ~/.m2/settings.xml, but apparently, these information are been used just for dependencies downloads.
When I run 'mvn test', these configurations aren't used on command line execution call. This is the instruction echoed on console:
${JAVA_HOME}/bin/java -jar /tmp/surefirebooter4156656684210940660.jar /tmp/surefire2646147996861949548tmp /tmp/surefire3498083351425809633tmp
There's a way to pass arguments to JVM during tests and other maven method executions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您对此感兴趣:如何配置 Java 的代理设置< /a>.或者,您可以尝试这些启动参数:
[EDIT]
这些属性也可以在
MAVEN_OPTS
中设置。 这篇文章描述了这对于测试配置文件如何工作。Perhaps this can be of interest to you: How do I configure proxy settings for Java. Alternatively you can try these startup parameters:
[EDIT]
These properties can also be set in
MAVEN_OPTS
. This post describes how this would work for the test-profile.要修复
pom.xml
上的一些参数,我们可以直接在 Surefire 插件配置上配置-DforkMode=never
。即基于
-DforkMode
的解决方案是由 这篇文章,由 @johan-sjoberg 在发表的评论中引用 这里To fix some arguments on
pom.xml
, we can configure-DforkMode=never
directly on surefire plugin configuration. i.e.The solution based on
-DforkMode
was suggested by this post, referenced by @johan-sjoberg on comments posted here