Skip to main content
Create Account Login Help

Main Menu

  • Home
  • Projects
  • Forums
  • People
  • Java User Groups
  • JCP
Last updated January 23, 2011 09:30, by lexi
spacer  

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:

confluence.highsource.org/display/MJIIP

Documentation

Maven JAXB2 Plugin documentation can be found here:

confluence.highsource.org/display/MJIIP/Documentation

Here's a couple of direct links:

  • Plugin documentation
  • User Guide
  • Quick Start
  • Sample Projects

 
 
spacer
spacer
Please Confirm
spacer
 
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.