iOS / iPadOS 17.2 开发者预览版 Beta 1内部版本号为21C5029g,距离上次发布隔了 16 天。在此版本中,我们终于迎来了手记应用!......
2023-11-04
IntelliJ IDEA提供了丰富的功能和工具,旨在提高开发者的生产力,简化开发过程,提升代码质量。IntelliJ IDEA具有智能代码助手、代码自动提示、代码重构、强大的插件生态系统等功能,使开发者能够更加高效地进行编码和调试。
现有一个 Maven 项目,通过 IntelliJ IDEA 的Open或者Import Project来打开或者导入该项目:
无法导入 maven 项目
如上图所示,导入Maven项目失败,提示:
无法导入maven项目:查看日志了解详细信息
即使我们点击Event Log,也可以获得不详细的错误信息:
事件日志
这时,我们需要通过Help -> Show Log in Finder来查看错误日志:
显示日志
在我们点击Show Log in Finder之后,会在弹出的目录中找到一个名为idea.log的日志文件,打开该文件,即可查看详细的错误日志:
2020-03-16 14:40:03,808 [13325330] INFO - ution.rmi.RemoteProcessSupport - Port/ID: 52340/Maven3ServerImpl952a326a
2020-03-16 14:40:05,385 [13326907] ERROR - #org.jetbrAIns.idea.maven - com.google.inject.CreationException: Unable to create injector, see the following errors:
1) No implementation for org.apache.maven.model.path.PathTranslator was bound.
while locating org.apache.maven.model.path.PathTranslator
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.pathTranslator(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContAIner$1.configure(DefaultPlexusContAIner.java:350)
2) No implementation for org.apache.maven.model.path.UrlNormalizer was bound.
while locating org.apache.maven.model.path.UrlNormalizer
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.urlNormalizer(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContAIner$1.configure(DefaultPlexusContAIner.java:350)
2 errors
java.lang.RuntimeException: com.google.inject.CreationException: Unable to create injector, see the following errors:
1) No implementation for org.apache.maven.model.path.PathTranslator was bound.
while locating org.apache.maven.model.path.PathTranslator
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.pathTranslator(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContAIner$1.configure(DefaultPlexusContAIner.java:350)
2) No implementation for org.apache.maven.model.path.UrlNormalizer was bound.
while locating org.apache.maven.model.path.UrlNormalizer
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.urlNormalizer(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContAIner$1.configure(DefaultPlexusContAIner.java:350)
2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:159)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at org.codehaus.plexus.DefaultPlexusContAIner.addComponent(DefaultPlexusContAIner.java:344)
at org.codehaus.plexus.DefaultPlexusContAIner.addComponent(DefaultPlexusContAIner.java:332)
at org.jetbrAIns.idea.maven.server.Maven3ServerEmbedderImpl.customizeComponents(Maven3ServerEmbedderImpl.java:555)
at org.jetbrAIns.idea.maven.server.Maven3ServerEmbedderImpl.customize(Maven3ServerEmbedderImpl.java:529)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
... omit some log ...
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - IntelliJ IDEA 2017.1.6 Build #IU-171.4694.73
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - JDK: 1.8.0_112
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - VM: Java HotSpot(TM) 64-Bit Server VM
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - Vendor: Oracle Corporation
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - OS: Mac OS X
2020-03-16 14:40:05,386 [13326908] ERROR - #org.jetbrAIns.idea.maven - Last Action: Maven.Reimport
通过错误日志,我们可以知道问题到底出在哪里。
对于上述问题,实际上就是 Maven 的版本与 IntelliJ IDEA 的版本不兼容的问题。
解决方法
在本案例中,两种版本分别为:
IntelliJ IDEA(2017.1.6)
Maven(3.6.3)
当我切换 Maven 的版本的3.2.5时候,该问题就解决了。
相关文章