解决无法启动Maven服务问题java.lang.RuntimeException: Cannot start maven service at

1、背景:

下载安装maven,配置环境变量,在idea中设置maven路径,在构建项目时,发现maven启动不成功,然后检查maven路径,maven与idea版本是否兼容,settings文件配置阿里中央仓库也解决不了,这个问题弄了好久,原来是VM参数配置错了,后来在VM options for importer 中添加参数 -Djava.net.preferIPv4Stack=true才解决

2、问题报错信息:maven启动失败

java.lang.RuntimeException: Cannot start maven service
at org.jetbrains.idea.maven.server.MavenServerConnector.connect(MavenServerConnector.java:159)
at org.jetbrains.idea.maven.server.MavenServerConnector.(MavenServerConnector.java:63)
at org.jetbrains.idea.maven.server.MavenServerManager.registerNewConnector(MavenServerManager.java:166)
at org.jetbrains.idea.maven.server.MavenServerManager.getConnector(MavenServerManager.java:154)
at org.jetbrains.idea.maven.server.MavenServerManager$2.create(MavenServerManager.java:396)
at org.jetbrains.idea.maven.server.MavenServerManager 2. c r e a t e ( M a v e n S e r v e r M a n a g e r . j a v a : 385 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . R e m o t e O b j e c t W r a p p e r . g e t O r C r e a t e W r a p p e e ( R e m o t e O b j e c t W r a p p e r . j a v a : 41 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . M a v e n E m b e d d e r W r a p p e r . d o C u s t o m i z e ( M a v e n E m b e d d e r W r a p p e r . j a v a : 93 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . s e r v e r . M a v e n E m b e d d e r W r a p p e r . l a m b d a 2.create(MavenServerManager.java:385) at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41) at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:93) at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.lambda 2.create(MavenServerManager.java:385)atorg.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)atorg.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:93)atorg.jetbrains.idea.maven.server.MavenEmbedderWrapper.lambdacustomizeForResolve$1(MavenEmbedderWrapper.java:66)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve(MavenEmbedderWrapper.java:65)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve(MavenEmbedderWrapper.java:59)
at org.jetbrains.idea.maven.project.MavenProjectResolver.executeWithEmbedder(MavenProjectResolver.java:285)
at org.jetbrains.idea.maven.project.MavenProjectResolver.resolveFolders(MavenProjectResolver.java:216)
at org.jetbrains.idea.maven.project.MavenProjectsProcessorFoldersResolvingTask.perform(MavenProjectsProcessorFoldersResolvingTask.java:40)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:145)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:36)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor 1. r u n ( M a v e n P r o j e c t s P r o c e s s o r . j a v a : 114 ) a t o r g . j e t b r a i n s . i d e a . m a v e n . u t i l s . M a v e n U t i l . l a m b d a 1.run(MavenProjectsProcessor.java:114) at org.jetbrains.idea.maven.utils.MavenUtil.lambda 1.run(MavenProjectsProcessor.java:114)atorg.jetbrains.idea.maven.utils.MavenUtil.lambdarunInBackground$5(MavenUtil.java:500)
at com.intellij.util.Runnabl

3、问题解决:VM options for importer 中添加参数 -Djava.net.preferIPv4Stack=true ,最后重新构建项目就好了
解决无法启动Maven服务问题java.lang.RuntimeException: Cannot start maven service at_第1张图片

你可能感兴趣的:(路过的一些坑BUG,Spring,boot)