我有一个Java 11应用程序,该应用程序在MAVEN的预一整合阶段测试中运行我的基于Spring-Boot的Web服务器,然后通过FailSafe在集成测试阶段运行集成测试。
我正在尝试将远程调试器连接到运行测试以跟踪问题。
我遇到的问题是,设置调试ARGS的MAVEN配置文件将导致在预一体式测试中启动的服务器侦听调试器,但FailSafe在激活配置文件时不会暂停。
我有 maven.failsafe.debug
通过在Failsafe文档上指示的配置文件设置的属性:
<profile>
<id>debug-it</id>
<properties>
<it.debugArgs>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:40000</it.debugArgs>
<maven.failsafe.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:40001 -Xnoagent -Djava.compiler=NONE</maven.failsafe.debug>
</properties>
</profile>
我已将Maven更新为3.8.5,并将FailSafe更新为最新的3.0.0-m6。
一个类似的配置文件在一年左右的时间迁移到Java 8到Java之前用于工作。
请注意,我还尝试在终端上直接手动设置FailSAFE调试选项,并以相同的结果设置。
知道我在做什么错吗?
I've got a java 11 application that runs my spring-boot based webserver in the maven pre-integration phase test then runs integration tests during the integration test phase via failsafe.
I'm trying to connect a remote debugger to the running tests to track down an issue.
The problem I'm running into is that my maven profile that sets the debug args will cause the server that is started in pre-integration-test to listen for a debugger but failsafe does not suspend as instructed when I activate the profile.
I have the maven.failsafe.debug
property set via the profile as instructed on the failsafe docs:
https://maven.apache.org/surefire/maven-failsafe-plugin/examples/debugging.html
<profile>
<id>debug-it</id>
<properties>
<it.debugArgs>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:40000</it.debugArgs>
<maven.failsafe.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:40001 -Xnoagent -Djava.compiler=NONE</maven.failsafe.debug>
</properties>
</profile>
I've updated maven to 3.8.5 and failsafe to the latest, 3.0.0-M6.
A similar profile used to work before migrating my service from java 8 to java 11 a year or so ago.
Note I've also tried manually setting the failsafe debug option directly on the terminal with the same result.
Any idea what I'm doing wrong?
发布评论