I wrote my own custom namespace for a Spring based project I’m working on. The project is built with maven, and I’d like to put my xsd files in the resources directory. The problem is the spring.schemas directory requires me to define where I put my xsd file. In my dev environment it will be resources/schemas/myschema.xsd. But, when I compile, the contents of the resources get copied to target, not the target directory itself. So in the compiled code, I end up with target/schemas/myschema.xsd. Should my spring.schemas file reference resources/schemas/myschema.xsd? Or just schemas/xsd?
thanks,
Jeff
When creating a custom namespace for Spring the spring.schemas file should be located in META-INF with an entry like this:
Your custom schema should be then in src/main/resources/org/springframework/context/config/ to be added in the classpath of the project.
Any good IDE should understand src/main/resources/ as a source code folder and read the schema just well.
NOTE: I pulled this example from the spring-core.jar, just examine it yourself