使用JMX时失败的Maven构建仍然卡住
我使用的(几乎)最新的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 startingRemove global
MAVEN_OPTS
and set-D*.jmxremote.*
perameters only for the required processYou can set perameters in intellij Run/Debug Configuration
When run from terminal:
export MAVEN_OPTS="" && mvn package
For run tests try this