Skip to content
Laurent Schoelens edited this page Aug 25, 2023 · 7 revisions

Basic usage

Simply add the plugin with the generate execution goal to the build:

<build>
	<plugins>
		<plugin>
			<groupId>org.jvnet.jaxb</groupId>
			<artifactId>jaxb-maven-plugin</artifactId>
			<executions>
				<execution>
					<id>generate</id>
					<goals>
						<goal>generate</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

In (very) old environments you may also need to set the maven-compiler-plugin to use at least 1.8 version for source and target:

<build>
	<plugins>
		...
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>
	</plugins>
</build>

See the sample purchase order project for example.

The plugin has a large number of configuration options. Please see the plugin documentation or the cheat sheet for a complete reference.

Clone this wiki locally