You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| xsdDir | DirectoryProperty | "$projectDir/src<br>/main/resources" | The directory holding the xsd files to compile. |
45
-
| includes | ListProperty\<String> |\[empty\]| An optional include pattern for the files in the xsdDir property |
46
-
| excludes | ListProperty\<String> |\[empty\]| An optional exclude pattern for the files in the xsdDir property |
47
-
| bindingFiles | FileCollection |\[empty\]| The binding files to use in the schema compiler |
48
-
| outputJavaDir | DirectoryProperty | "$buildDir/generated<br>/sources/xjc/java" | The output directory for the generated Java sources.<br>Note that it will be deleted when running XJC. |
49
-
| outputResourcesDir | DirectoryProperty | "$buildDir/generated<br>/sources/xjc/resources" | The output directory for the generated resources (if any).<br>Note that it will be deleted when running XJC. |
50
-
| useJakarta | Provider\<Boolean> | true | Set to use the `jakarta` namespace. If false, uses the `javax` namespace. This value determines the default version of XJC and the JAXB binding provider. |
51
-
| xjcVersion | Provider\<String> | "3.0.2" for jakarta / "2.3.8" for javax | The version of XJC to use. |
52
-
| defaultPackage | Provider\<String> |\[not set\]| The default package for the generated Java classes.<br>If empty, XJC will infer it from the namespace. |
53
-
| generateEpisode | Provider\<Boolean> | false | If true, generates an Episode file for the generated Java classes. |
54
-
| markGenerated | Provider\<Boolean> | false | If true, marks the generated code with the annotation `@javax.annotation.Generated`. |
55
-
| options | ListProperty\<String> |\[empty\]| Options to pass to either the XJC core, or to third party plugins in the `xjcPlugins` configuration |
56
-
| groups | NamedDomainObjectContainer |\[empty\]| Allows you to group a set of XSDs and generate sources with different configurations. Requires Gradle 7.0 or higher. See below for details. |
57
-
| addCompilationDependencies | Provider\<Boolean> | true | Adds dependencies to the `implementation` configuration for compiling the generated sources. These includes `jakarta.xml.bind:jakarta.xml.bind-api` and possibly `jakarta.annotation:jakarta.annotation-api`. |
| xsdDir | DirectoryProperty | "$projectDir/src<br>/main/resources" | The directory holding the xsd files to compile. |
45
+
| includes | ListProperty\<String> |\[empty\]| An optional include pattern for the files in the xsdDir property |
46
+
| excludes | ListProperty\<String> |\[empty\]| An optional exclude pattern for the files in the xsdDir property |
47
+
| bindingFiles | FileCollection |xsdDir.asFileTree.matching<br> { include("**/*.xjb") }| The binding files to use in the schema compiler |
48
+
| outputJavaDir | DirectoryProperty | "$buildDir/generated<br>/sources/xjc/java" | The output directory for the generated Java sources.<br>Note that it will be deleted when running XJC. |
49
+
| outputResourcesDir | DirectoryProperty | "$buildDir/generated<br>/sources/xjc/resources" | The output directory for the generated resources (if any).<br>Note that it will be deleted when running XJC. |
50
+
| useJakarta | Provider\<Boolean> | true | Set to use the `jakarta` namespace. If false, uses the `javax` namespace. This value determines the default version of XJC and the JAXB binding provider. |
51
+
| xjcVersion | Provider\<String> | "3.0.2" for jakarta /<br> "2.3.8" for javax| The version of XJC to use. |
52
+
| defaultPackage | Provider\<String> |\[not set\]| The default package for the generated Java classes.<br>If empty, XJC will infer it from the namespace. |
53
+
| generateEpisode | Provider\<Boolean> | false | If true, generates an Episode file for the generated Java classes. |
54
+
| markGenerated | Provider\<Boolean> | false | If true, marks the generated code with the annotation `@javax.annotation.Generated`. |
55
+
| options | ListProperty\<String> |\[empty\]| Options to pass to either the XJC core, or to third party plugins in the `xjcPlugins` configuration |
56
+
| groups | NamedDomainObjectContainer |\[empty\]| Allows you to group a set of XSDs and generate sources with different configurations. Requires Gradle 7.0 or higher. See below for details. |
57
+
| addCompilationDependencies | Provider\<Boolean> | true | Adds dependencies to the `implementation` configuration for compiling the generated sources. These includes `jakarta.xml.bind:jakarta.xml.bind-api` and possibly `jakarta.annotation:jakarta.annotation-api`. |
58
58
59
59
### Choosing which schemas to generate source code for
60
60
@@ -158,13 +158,14 @@ The file will be generated at META-INF/sun-jaxb.episode and added as a resource
158
158
XJC can consume the episode files so that it is possible to compile java classes from a schema in one project, and consume it in XJC generators in other
159
159
projects, so you don't have to compile the same schemas multiple times.
160
160
To do this, you need to add the jar file to the configuration named "xjcBindings".
161
+
This is done using normal Gradle dependency management.
161
162
162
163
For multi-projects, assuming the episode file is generated in a project called "test-producer", you can do this like this:
@@ -174,9 +175,7 @@ You can also provide your own binding files (or custom episode files) through th
174
175
175
176
```kotlin
176
177
xjc {
177
-
bindingFiles.from(layout.projectDirectory.dir("src/main/xjb")) // Everything in the src/main/xjb directory
178
-
// or
179
-
bindingFiles.from(xsdDir.asFileTree.matching { include('**/*.xjb') }) // Files with an .xjb extension in the xsdDir directory (defaulting to src/main/resources)
178
+
bindingFiles = layout.projectDirectory.dir("src/main/xjb").asFileTree.matching { include("**/*.xjb") } // Files with an .xjb extension in the "src/main/xjb" directory
180
179
}
181
180
```
182
181
@@ -244,7 +243,7 @@ Lastly, for both `jakarta` and `javax`, configure the plugin to use the binding
0 commit comments