Skip to content
highsource edited this page Oct 12, 2014 · 23 revisions

JAXB2 Maven Plugin

Welcome to the maven-jaxb2-plugin wiki.

These pages document the maven-jaxb2-plugin (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin).

If you are interested in the Codehaus JAXB2 Maven Plugin (org.codehaus.mojo:jaxb2-maven-plugin), please follow this link to the corresponding website.

Quick start

  • Put your schemas (*.xsd) and bindings (*.xjb) into the src/main/resources folder.
  • Add the plugin to your pom.xml:
<project ...>
	<build>
		<plugins>
			<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<version><!-- Current version --></version>
					<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
						</execution>
				</executions>
			</plugin>
			<!-- ... -->
		</plugins>
	</build>
</project>
  • Configure your maven-compiler-plugin to use at least Java 1.5 source and target versions.

See the basic project sample.

Clone this wiki locally