使用JMX时失败的Maven构建仍然卡住

发布于 2025-01-31 21:17:50 字数 1043 浏览 2 评论 0原文

我使用的(几乎)最新的Intellij Ultimate 2022.1.1(与最新的VS代码相同),使用JDK 8和Maven 3.6.3(无法升级)

执行Maven构建(作为Compile/Package),并且失败(例如汇编错误)

我无法重新运行,因为端口1100仍然由java.exe进程使用,我必须

在围绕围绕的工作时手动杀死我在命令行中杀死命令行

FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :1100') DO TaskKill.exe /F /PID %P

jps输出:

RMI Registry not available at 11808:1099
Exception creating connection to: 11808; nested exception is:
        java.net.SocketException: Network is unreachable: connect

**编辑**

问题是由于环境变量maven_opts jmxremote.port 1100用于激活JMX的JConsole

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1100

I'm using (almost) latest Intellij Ultimate 2022.1.1 (same with latest VS Code) with JDK 8 and maven 3.6.3 (can't upgrade)

When executing Maven build (as compile/package) and it fails (for example compilation error)

I can't rerun because port 1100 is still used by a java.exe process I must kill manually

As a work around I kill process in command line dynamically

FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :1100') DO TaskKill.exe /F /PID %P

jps output :

RMI Registry not available at 11808:1099
Exception creating connection to: 11808; nested exception is:
        java.net.SocketException: Network is unreachable: connect

**EDIT **

Problem was due to environment variable MAVEN_OPTS jmxremote.port 1100 used for activate JMX for JConsole

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1100

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你好,陌生人 2025-02-07 21:17:50

Intellij启动了Maven背景过程以导入依赖关系(以及其他事项),并且无法将其关闭以更快地重新运行。此背景过程使用maven_opts就像普通的Maven进程一样,并倾听端口,阻止其他Maven进程启动启动启动

recome maven_opts 和set -d*.jmxremote。*仅针对所需的过程

  • 您可以在Intellij Run/debug Configuration中设置perameter

  • 当从终端运行时:export maven_opts =“”&& MVN软件包

  • 用于运行测试的MVN软件包尝试 this

Intellij starts maven background process to import dependencies (and other things) and doesn't close it for faster re-run. This background process uses MAVEN_OPTS just like normal maven process and listens port preventing other maven processes from starting

Remove global MAVEN_OPTS and set -D*.jmxremote.* perameters only for the required process

  • You can set perameters in intellij Run/Debug Configuration

  • When run from terminal: export MAVEN_OPTS="" && mvn package

  • For run tests try this

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文