I'm trying to develop XML-based software. I'm using Maven & XmlBeans.
I have a base-project
which provides base-xml-schemas
which define some elements, abstract types, etc,.
All other sub-projects
also provides xml-schemas. But, these sub-projects imports/refers the base-xml-schemas
to use & extend the elements / types defined by base-schemas
.
Even though my sub-projects
depends on base-project
, xmlbeans plugin requires the base-xml-schemas
to be present in schemaDirectory
for its usage. As an implication, all my sub-projects now carry the duplicate content generated/compiled due to base-xml-schemas
.
I want my sub-projects
to have only those sub-project-specific schemas & content in their jar, as My base-project
will be available to all applications in my Jboss & the types can be resolved in runtime.
Having understood that the xmlbean needs all the schemas referred to be present for code generation, now I want to delete all xmlbean-generated code due to the present of base-xml-schema
and retain files related to sub-project
specific schemas.
I have manually done this and my project compilation & runtime works fine, as my maven has dependency & classes are available in runtime.
My question is - How to automate this using maven so the files generated due to base-schema
is deleted just after generation.