Enviroment
I've multiple ant tasks where each of them generates the java code from one XSD for different packages. All tasks are always executed but one after another.
Within those xsds some elements may be defined multiple times but just once per file. Those elements should be placed in different packages. For example:
A_v1.xsd - contains:
-> <xs:element name="A"> => my.package.a_v1.A.java
A_v2.xsd - contains:
-> <xs:element name="A"> => my.package.a_v2.A.java
This works fine.
Question
How to translate that into maven?
Problem / What I've tried
I could not create multiple plugin executions in the pom, configure them different and let them run at the same time.
So I tried generating all Java Code from the XSDs in one step but this leads to an exception stating that some fields are already defined.
I also tried to add bindings like:
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<jxb:bindings schemaLocation="A_v1.xsd" >
<jxb:schemaBindings>
<jxb:package name="my.package.a_v1"/>
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="A_v2.xsd" >
<jxb:schemaBindings>
<jxb:package name="my.package.a_v2"/>
</jxb:schemaBindings>
</jxb:bindings>
But the failure is still the same.
Any help will be appreciated! Thanks in advance!