# Using JAXB from Maven

If you are using Maven 2 as your build system, you can declare the following dependencies in your POM for using the JAXB RI. Replace the version with the version of your choice.

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>&jaxb.release.impl.version;</version>
    </dependency>

This artifact is available in the java.net Maven repository, so you also need the following `<repository>` declaration in your POM:

    <repository>
      <id>java.net</id>
      <url>https://maven.java.net/content/repositories/releases/</url>
      <layout>default</layout>
    </repository>

For a list of available artifacts and versions, see this. In addition to the runtime jar, XJC is available under the artifact Id "`jaxb-xjc`".

You can also invoke XJC through a Maven plugin by using the Maven2 JAXB 2.x plugin.