14

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:\Projects\workspaces\mj2p\maven-jaxb2-plugin-project\tests\JAXB-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} @ 

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:

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

Community
  • 1
  • 1
lexicore
  • 42,748
  • 17
  • 132
  • 221

4 Answers4

11

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.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Just rechecked: `JAVA_HOME` is set correctly, the workspace is set up with a JDK. I'm not quite sure how to debug this. – lexicore Oct 16 '14 at 06:09
  • Any chance `mvn:help-effective-pom` works and if so what output does it give? – Raghuram Oct 16 '14 at 13:18
  • 2
    Please see my other answer. This is an Eclipse bug (`java.home` is not being passed correctly by default). – lexicore Dec 13 '14 at 22:15
  • in my case JAVA_HOME was not pointing to the bin directory but to its parent. Fixing this solved my problem – fer.marino Nov 12 '15 at 09:15
  • 2
    `JAVA_HOME` should point to the folder immediatly _above_ the `bin` folder . Then you add `%JAVA_HOME%\bin` to your `PATH` variable, or `$JAVA_HOME/bin` – aliopi Jan 22 '18 at 15:08
8

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
Community
  • 1
  • 1
lexicore
  • 42,748
  • 17
  • 132
  • 221
2

the pom for com.sun.xml.bind:jaxb-osgi:jar:2.2.10 is invalid issue. worked for me after updating the rest-assured version to 4.1.1.

0

As others pointed out, this might happen because the JRE is setup incorrectly within Eclipse.

I solved it by adding the correct entry (pointing to where mi JDK is installed) inside Window>Preferences>Java>Installed JRE's

After this change, a project clean might be necessary.

enter image description here

Felipe Guajardo
  • 165
  • 3
  • 12