获取 <name> 的 POM无效,传递依赖(如果有)将不可用"仅在 Eclipse 中

2022-01-19 00:00:00 eclipse maven jaxb m2e

我最近升级到 JAXB 2.2.11,并在我的 Eclipse 控制台中注意到以下消息:

I have recently upgraded to JAXB 2.2.11 and noticed in my Eclipse console the following message:

10/15/14, 11:42:46 PM GMT+2: [INFO] Creating new launch configuration
10/15/14, 11:42:58 PM GMT+2: [INFO] C:Projectsworkspacesmj2pmaven-jaxb2-plugin-project	estsJAXB-1044
10/15/14, 11:42:58 PM GMT+2: [INFO]  mvn  -B -X -e clean install
10/16/14, 12:09:07 AM GMT+2: [WARN] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for com.sun.xml.bind:jaxb-impl:2.2.11
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} @ 

10/16/14, 12:09:07 AM GMT+2: [WARN] The POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for com.sun.xml.bind:jaxb-xjc:2.2.11
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} @ 

10/16/14, 12:09:07 AM GMT+2: [WARN] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for com.sun.xml.bind:jaxb-core:2.2.11
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} @ 

令我困惑的是,我没有在控制台中收到此警告.有问题的 pom 似乎也是正确的.我确定我在控制台和 Eclipse (m2e) 中使用相同的 Maven 安装.存储库似乎也是正确的.

What puzzles me is that I am not getting this warning in console. The poms in question also seems to be correct. I am sure I am using the same Maven installation in the console and in Eclipse (m2e). The repository also seems to be correct.

有谁知道,这可能是什么原因造成的?

Does anyone happen to know, what could be causing this?

请注意,这不是重复的(几乎同名)问题:

Please note that this is not a duplicate for (almost identically-named) question:

  • 该<name> 的 POM无效,传递依赖(如果有)将不可用

这个问题是关于在控制台和 Eclipse 中执行 Maven 之间的区别.

This question is about the differences between Maven execution in the console and from the Eclipse.

推荐答案

经过进一步调查,我似乎遇到了和这个问题一样的问题:

After further investigation it appears that I have the same problem as in this question:

Maven 没有正确选择 JAVA_HOME

感谢@rustyx的解决方案(请支持该答案):

The solution thanks to @rustyx (please upvote that answer):

要解决这个问题,您需要使用 JDK 中的 JRE 启动 Eclipse,方法是在 eclipse.ini(在 -vmargs 之前!)添加类似这样的内容:

To fix the issue you need to start Eclipse using the JRE from the JDK by adding something like this to eclipse.ini (before -vmargs!):

-vm
C:<your_path_to_jdk170>jreinjavaw.exe

相关文章