Getting “The POM for <name> is invalid, transitive dependencies (if any) will not be available” only in Eclipse

人走茶凉 提交于 2019-12-04 05:47:25

The pom for com.sun.xml.bind.jaxb-impl has com.sun.xml.bind:jaxb-parent has its parent.

jaxb-parent pom has the following section:

<profile>
    <id>default-tools.jar</id>
    <activation>
        <file>
            <exists>${java.home}/../lib/tools.jar</exists>
        </file>
    </activation>
    <properties>
        <tools.jar>${java.home}/../lib/tools.jar</tools.jar>
    </properties>
</profile>
<profile>
    <id>default-tools.jar-mac</id>
    <activation>
    <file>
        <exists>${java.home}/../Classes/classes.jar</exists>
    </file>
    </activation>
    <properties>
        <tools.jar>${java.home}/../Classes/classes.jar</tools.jar>
    </properties>
</profile>

In your Eclipse, neither of the profile seems to be activated due to which ${tools.jar} does not have a value.

One possibility could be JAVA_HOME value is set incorrectly.

lexicore

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

Maven not picking JAVA_HOME correctly

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

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>\jre\bin\javaw.exe
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!