JAXB Maven Plugin
- Supports JAXB 2 and JAXB 3.
Provenance
This is a fork of the JAXB2 Maven Plugin from phax/maven-jaxb2-plugin, which is itself a fork on highsource/maven-jaxb2-plugin, and we suspect that was itself a fork of the javaee/metro-maven-jaxb2-plugin which originated from java.net.
The plugin from which this was forked has been commonly known as the: "jvmnet JAXB2 Plugin".
The purpose of our fork is to add support for JAXB 3.
Notes on Licensing
The forks from which this project came claim that it is licensed under a BSD-2 Clause license. However, there is also evidence of Apache 2.0 licensed code within the project. The code in the original java.net project appears instead to have been dual-licensed as CDDL 1.1 and GPL 2 + Classpath Exception license.
Whilst we believe it is likely that this code is Open Source and resides under a mix of the above discussed licenses, the exact licensing of the code remains murky at best.
Introduction
Welcome to the JAXB Maven Plugin, the most advanced and feature-full Maven plugin for XML Schema compilation.
This Maven plugin wraps and enhances the JAXB Schema Compiler (XJC) and allows compiling XML Schemas (as well as WSDL, DTDs, RELAX NG) into Java classes in Maven builds.
If you are interested in the Mojohaus 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 thesrc/main/resources
folder. - Add the plugin to your
pom.xml
:
For JAXB 3:
<project ...>
...
<build>
<plugins>
...
<plugin>
<groupId>com.evolvedbinary.maven.jvnet</groupId>
<artifactId>jaxb30-maven-plugin</artifactId>
<version>0.15.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
...
</project>
For JAXB 2:
Use: <artifactId>jaxb2-maven-plugin</artifactId>
instead.
JAXB Versions
If you need a specific JAXB version, you can explicitly use one of the following variants:
com.evolvedbinary.maven.jvnet:jaxb30-maven-plugin
- JAXB 3.0.com.evolvedbinary.maven.jvnet:jaxb23-maven-plugin
- JAXB 2.3.com.evolvedbinary.maven.jvnet:jaxb22-maven-plugin
- JAXB 2.2.com.evolvedbinary.maven.jvnet:jaxb2-maven-plugin
- "latest 2.x version"; at the moment this is same ascom.evolvedbinary.maven.jvnet:jaxb23-maven-plugin
.
Java versions
Supported Java versions are 1.8
and onwards.
Documentation
Please refer to the Wiki for the full documentation.
Support
Whilst this fork is an Open Source project, developing this plugin is not our key occupation. We are happy for users to open issues, however we make no claims that we will investigate or resolve them.
We will gladly accept and merge Pull-Requests that address issues, but they must be accompanied by tests and be compatible with Java 8+.
The original author of the plugin may also be able to offer you some support, see Support.
- User Guide
- Maven Documentation (Work in progress)
- Configuration Cheat Sheet
- Common Pitfalls and Problems (Work in progress)
- Best Practices (Work in progress)
- FAQ
- Sample Projects
- License