Using XJC Extensions
Workers
kotlin
import io.mateo.cxf.codegen.workers.Wsdl2JavaOption
// ...
dependencies {
implementation("org.apache.cxf.xjc-utils:cxf-xjc-runtime:4.0.0") // <1>
cxfCodegen("org.apache.cxf.xjcplugins:cxf-xjc-ts:4.0.0") // <2>
}
cxfCodegen {
options {
register<Wsdl2JavaOption>("calculator") { // <5>
wsdl = layout.projectDirectory.file("calculator.wsdl").asFile.toPath().toAbsolutePath().toString()
xjcArgs.add("-Xts") // <3>
}
}
}groovy
import io.mateo.cxf.codegen.workers.Wsdl2JavaOption
// ...
dependencies {
implementation "org.apache.cxf.xjc-utils:cxf-xjc-runtime:4.0.0" // <1>
cxfCodegen "org.apache.cxf.xjcplugins:cxf-xjc-ts:4.0.0" // <2>
}
cxfCodegen {
options {
register("calculator", Wsdl2JavaOption) {
wsdl = layout.projectDirectory.file("calculator.wsdl").asFile.toPath().toAbsolutePath().toString()
xjcArgs.add("-Xts") // <3>
}
}
}- Add the required CXF JXC dependency to your application dependencies.
- Add the extension dependency to the tool classpath.
- Specify extension ID that corresponds to the added dependency from (2); the
-xjcprefix is not required when using thexjcArgsproperty.
Task
kotlin
import io.mateo.cxf.codegen.wsdl2java.Wsdl2Java
// ...
dependencies {
implementation("org.apache.cxf.xjc-utils:cxf-xjc-runtime:4.0.0") // <1>
cxfCodegen("org.apache.cxf.xjcplugins:cxf-xjc-ts:4.0.0") // <2>
}
tasks.register("calculator", Wsdl2Java::class) {
toolOptions {
wsdl = layout.projectDirectory.file("calculator.wsdl").asFile.toPath().toAbsolutePath().toString()
xjcArgs.add("-Xts") // <3>
}
}groovy
import io.mateo.cxf.codegen.wsdl2java.Wsdl2Java
// ...
dependencies {
implementation "org.apache.cxf.xjc-utils:cxf-xjc-runtime:4.0.0" // <1>
cxfCodegen "org.apache.cxf.xjcplugins:cxf-xjc-ts:4.0.0" // <2>
}
tasks.register("calculator", Wsdl2Java) {
toolOptions {
wsdl = layout.projectDirectory.file("calculator.wsdl").asFile.toPath().toAbsolutePath().toString()
xjcArgs.add("-Xts") // <3>
}
}- Add the required CXF JXC dependency to your application dependencies.
- Add the extension dependency to the tool classpath.
- Specify extension ID that corresponds to the added dependency from (2); the
-xjcprefix is not required when using thexjcArgsproperty.