Skip to content

Remote schema url #28

@dtuchs

Description

@dtuchs

Hello!
I`am very satisfied with your plugin, however, it is unable to use it with a schema distributed over HTTP.
For WSDL, it is common practice to distribute the file over HTTP, additionally, Ant handles schemaUrl without any issues:

Working:

tasks.register('genJaxb') {
    ext.sourcesDir = "${buildDir}/generated-sources/jaxb"
    ext.classesDir = "${buildDir}/classes/jaxb"
    ext.schema = "http://127.0.0.1:8089/ws/userdata.wsdl"

    outputs.dir classesDir

    doLast() {
        project.ant {
            taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask", classpath: configurations.jaxb.asPath
            mkdir(dir: sourcesDir)
            mkdir(dir: classesDir)

            xjc(destdir: sourcesDir, schema: schema, package: "guru.qa.niffler.userdata.wsdl") {
                arg(value: "-wsdl")
                produces(dir: sourcesDir, includes: "**/*.java")
            }

            javac(destdir: classesDir, source: 17, target: 17, debug: true, debugLevel: "lines,vars,source", classpath: configurations.jaxb.asPath) {
                src(path: sourcesDir)
                include(name: "**/*.java")
                include(name: "*.java")
            }
        }
    }
}
  • not working (both with new File(newURI(...).toUrl))
xjcGeneration {
    defaultAdditionalXjcOptions = ['encoding': 'UTF-8']
    schemas {
        wsdlSchema {
            schemaFile = 'http://127.0.0.1:8089/ws/userdata.wsdl'
            javaPackageName = 'jaxb.userdata'
            sourceSet = 'test'
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions