Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote schema url #28

Open
dtuchs opened this issue Aug 15, 2024 · 1 comment
Open

Remote schema url #28

dtuchs opened this issue Aug 15, 2024 · 1 comment

Comments

@dtuchs
Copy link

dtuchs commented Aug 15, 2024

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'
        }
    }
}

@edeandrea
Copy link
Owner

Hello @dtuchs sorry for the delay in my response. I will take a quick look, although I have not really been maintaining this plugin unfortunately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants