Community
Participate
Working Groups
JAXB schema generation generates a schema per namespace/package, but Dali does not handle this well. The user picks *one* schema file name and the generation mechanism (Main.JptSchemaOutputResolver to be specific) uses that file name for every namespace, which will result in a schema with errors. We should either: a) Limit the user to one package so that only one schema is generated (although it's unclear if that will always work, especially when that package statically references JAXB classes in other packages) or: b) Provide a more complete schema output resolver. This may either require *less* user interaction (i.e. they can choose a folder, but not file names) or *more* user interaction (i.e. they have to choose a schema name/location for each namespace).
I'm not seeing the same thing when I try to reproduce this. When I generate from multiple packages I get 1 schema with types defined for all of the classes in all of the specified packages. No namespace is defined. I had the same experience using MOXy and the JAXB RI schema generation.
I assume the difference is in the classes. I don't have a namespace defined, or any JAXB annotations to begin with in this case, so I assume side-steps the problem you are encountering. So my observations would probably only apply to that corner case.
Yes, I discovered this while trying to determine what the @XmlSchema.location() value was for. I have two packages with namespaces defined on the package annotations. When there are no package annotations, the default namespace is "", and so all packages go into one namespace. You'd see similar things if you actually set all packages to have the same namespace. So the issue is really multiple namespaces, not multiple packages, per se.
Created attachment 180910 [details] example project Here's a project with two packages, two namespaces, and should generate two schemas.
Completed in M3 The final implementation have the schema generation create files with the namespace as file name. In the case where there is no namespace specified, the schema file name will be the default file name given by the user. If multiple schemas are generated, the file name sequence number will be incremented.
Verified in Build I-3.3.0-20101209114749 Verified multiple schemas are created using namespace, if not provided schemas are created with default or file name given by user. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0_M3