Skip to main content
Last updated January 23, 2011 09:30, by lexi
Feedicon  

Maven 2 JAXB 2.x Plugin

This Maven 2 plugin wraps the JAXB 2.x XJC compiler and provides the capability to generate java sources from schemas.

Quickstart

  • Put your schemas (*.xsd) and bindings (*.xjb) into the src/main/resources folder.
  • Add the plugin to your build:
    <code><build>
    	<plugins>
    		<plugin>
    			<groupId>org.jvnet.jaxb2.maven2</groupId>
    			<artifactId>maven-jaxb2-plugin</artifactId>
    			<executions>
    				<execution>
    					<goals>
    						<goal>generate</goal>
    					</goals>
    				</execution>
    			</executions>
    		</plugin>
    	</plugins>
    </build></code>
  • Reconfigure the compiler plugin to use at least Java 1.5:
    <code><build>
    	<plugins>
    		...
    		<plugin>
    			<inherited>true</inherited>
    			<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-compiler-plugin</artifactId>
    			<configuration>
    				<source>1.5</source>
    				<target>1.5</target>
    			</configuration>
    		</plugin>
    	</plugins>
    </build></code>

See the sample purchase order project for example.

Project Homepage

Maven JAXB2 Plugin project homepage can be found at the following address:

http://confluence.highsource.org/display/MJIIP

Documentation

Maven JAXB2 Plugin documentation can be found here:

http://confluence.highsource.org/display/MJIIP/Documentation

Here's a couple of direct links:

 
 
Close
loading
Please Confirm
Close