Declaring JAXB as a dependency. What for?

Why do you want to declare JAXB as a dependency of your Java application, since it comes with the JRE anyway and cannot be overridden in your path to the application classes?

Using jersey-json , in their POM file, they declare a dependency on jaxb-impl without specifying the exact version. What do they get by doing this?

And also, when I add a jersey-json dependency in my own POM file, I get jaxb-api.jar and jaxb-impl.jar in my class path. Why do I want this to happen? Isn't the JVM implementation loaded by default if I don't put the files in the supported libraries directory?

+5
source share
2 answers

:

    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
    </dependency>

pom, , , / ( ).

, , , JAXB 2 API , JAXB.

JRE JAXB impl, JAXB RI 2.1.7. , .

, JRE JAXB-, , .

, , JAXB, : ( ); JAXB API, JAXB 2.2.x( JRE); ( API / ) ..

, , , JAXB. , - - . , JAXB RI , .

+1

, . , , "" .

0

All Articles