Open andygoossens opened 5 years ago
@andygoossens Is there a reason you can't pass it as an XJC argument (e.g. -catalog <file>
?
Similar to this example:
I know I can pass it as a XJC argument, but the Gradle build will fail before reaching the "xjc" task. Task "xjc" depends on "xsd-dependency-tree" and it is the latter that fails.
I have tried excluding "xsd-dependency-tree", but that won't work either:
./gradlew clean xjc -x xsd-dependency-tree
> Task :xjc FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':xjc'.
> Cannot get property 'managedNodes' on null object
@andygoossens : i have the same problem, did you find a solution ? Thank you
@drapej: I am not using this plugin anymore for my module that has this error. I went back to using Ant task XJC2Task.
@andygoossens : ok thank you. Is it possible to share your build.gradle with this ant task ?
@drapej: I cannot share the actual code as it can be considered to be proprietary, but it looks like this: https://stackoverflow.com/a/41880497
The plugin is unable to cope with import tags without a schemaLocation attribute. e.g.
If it encounters such tag, then the build will fail with a rather undescriptive error message:
I have created a simple testcase repository to reproduce this issue. While I can work around this issue by mentioning a schemaLocation attribute, I would rather avoid that. (The XSD files were copied from RFC 5730 and diverging from those would be undesirable.)
If I would be calling the Ant task XJC2Task directly, then I would have been able to provide a catalog file which it would use to understand how the namespaces and files fit together. Unfortunately, gradle-jaxb-plugin does not seem to support that. :-(