# 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>2.1.8</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>http://download.java.net/maven/1</url>
      <layout>legacy</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.