Community
Participate
Working Groups
Create a JAXB project with classes, generate a schema. If you didn't create a package-info.java when creating your classes, your generated schema has by default no namespace. You also get no validation (shouldn't be invalid at this point, because you just generated) because the generated schema was not added to the library. This should probably be done. Add schema to library. Add a package-info.java to project, specify namespace information. Generate schema again. At this point, the schema library is pointing to the proper schema, but using an incorrect namespace. There is also a warning that there is not a schema in the library for the namespace used by the package. There should be a better mechanism here. Either the existing library entry should be updated to use the correct namespace, or there should be validation that the existing library entry doesn't have the namespace the library says it does. There is also no way to edit the schema entry in the library to update the namespace. Perhaps there should be a "reload" button.
It's currently impossible to add the schema to the project properties post-generate at this point, because the process that generates the schema (what the process is depends on the platform: MOXy or Metro) doesn't use the name of the schema that we provide, and doesn't let us know what the name it used is. Other than that, I refactored the schema library code to not store the namespace of the schema. It now always introspects the schema to determine the namespace, and refreshes are done at appropriate points. Committed for 3.1 M3