ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: :caution-caption: :fire: :warning-caption: :warning: endif::[] :github-pages-uri: https://dlmiles.github.io/gradle-xjc-plugin :github-uri: https://github.com/dlmiles/gradle-xjc-plugin :github-m2-uri: https://maven.pkg.github.com/dlmiles/gradle-xjc-plugin :maven-groupId: org.unbroken-dome :maven-groupId-new: org.darrylmiles.forked.org.unbroken-dome :uri-build-status: https://github.com/dlmiles/gradle-xjc-plugin/actions/workflows/build.yml :img-build-status: https://github.com/dlmiles/gradle-xjc-plugin/actions/workflows/build.yml/badge.svg :current-release-version: 2.2.0 :current-snapshot-version: 2.3.0-SNAPSHOT
ifdef::env-github[] image:{img-build-status}[CI-Gradle-build,link={uri-build-status}]
Java 8
and Java 11
for plugin project builderJava 8
, Java 11
, Java 17
and Java 21
Gradle 5.6
through Gradle 8.7
endif::[]
= Gradle XJC Plugin
Invokes the xjc
binding compiler from a Gradle build.
== Features
com.sun.xml.bind
versions 2.1 (legacy), 2.2, 2.3, 2.4, 3.0 (jakarta) and
4.0 (jakarta) which is the reference implementation now hosted by Eclipse® foundation
under the EE4J project.maven:
and classpath:
URI resolution (similar to
maven-jaxb2-plugin) as well as the standard file,jar,jar:file,http,https sources.== Requirements
The Gradle plugin itself:
The XJC Tool requirements:
== Quick Start
Apply the {maven-groupId}.xjc
plugin to your Gradle build script and add an appropriate
dependency on the JAXB API:
pluginManagement { repositories { maven { //url = uri("{github-pages-uri}/java8/maven2") url = uri("{github-m2-uri}") content { // this repository only contains artifacts for specific groups includeGroup("org.unbroken-dome.xjc") includeGroup("org.unbroken-dome") ifdef::env-github[]
includeGroup("{maven-groupId-new}.xjc")
includeGroup("{maven-groupId-new}")
endif::[] } credentials { // github requires any valid credentials even to GET packages username = System.getenv("GITHUB_USERNAME") // this token requires scope 'read:packages' password = System.getenv("GITHUB_TOKEN") } } }
// Official releases only
gradlePluginPortal()
plugins { id("{maven-groupId}.xjc") version "{current-release-version}" }
Put your schemas (.xsd
), binding customization files (.xjb
) and catalogs (.cat
)
into src/main/schema
.
That's it! The plugin will automatically invoke XJC to generate code from your schemas and include
it the main
Java compilation.
== Further Documentation
{github-pages-uri}/[User Manual]
{github-pages-uri}/dokka/docs/[API/DSL Documentation]
{github-m2-uri}/[Github Maven2 Package Browse]
{github-pages-uri}/java8/maven2/[Github-Pages Maven2 Artifact Browse]
{github-pages-uri}/artifacts/[Maven2 Artifact Archive Download]
{github-pages-uri}/java8/tests/[Java 8 Test Reports]
{github-pages-uri}/java11/tests/[Java 11 Test Reports]