如何 运行 在 maven embedded-glassfish 服务器上进行远程调试?

How to run remote debugging on maven embedded-glassfish server?

我当前的嵌入式 glassfish 插件

<plugin>
  <groupId>org.glassfish</groupId>
  <artifactId>maven-embedded-glassfish-plugin</artifactId>
  <version>3.1</version>
  <configuration>
    <app>${basedir}/target/${project.artifactId}-${project.version}.${project.packaging}</app>
    <port>8001</port>
    <contextRoot>services</contextRoot>
  </configuration>
</plugin>

我已经使用 mvn embedded-glassfish:run 启动了嵌入式 glassfish 服务器,并尝试 运行 在端口 8001 上进行远程调试但未成功,出现以下错误...

Error running local glassfish debug: Unable to open debugger port (localhost:8001): java.io.IOException "handshake failed - connection prematurally closed"

启用远程调试需要做什么?

尝试 运行 嵌入式 Glassfish Server Maven-command:

mvnDebug embedded-glassfish:run

然后将远程调试器连接到端口 8000。