Basic Usage - highsource/jaxb-tools GitHub Wiki
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.