See below, I have 3 projects as mentioned.
Common
Age.xsd (namespace: http://xmlns.common/age)
generated/common/xmlns/age/AgeType.java
pom.xml (cxf-xjc-plugin xsdtojava)
Person
PersonService.wsdl (imports Age.xsd in wsd:types)
generated/com/person/AgeType.java
pom.xml (cxf-codegen-plugin wsdl2java)
Animal
AnimalService.wsdl (imports Age.xsd in wsd:types)
generated/com/animal/AgeType.java
pom.xml (cxf-codegen-plugin wsdl2java)
Both AnimalService.wsdl
and PersonService.wsdl
imports the Age.xsd schema as mentioned below:
<wsdl:definitions xmlns:cn="http://xmlns.common/age"
<wsdl:types>
<xsd:schema>
<xsd:import
namespace="http://xmlns.common/age"
schemaLocation="classpath:/common/xmlns/age/Age.xsd" />
</xsd:import>
</xsd:schema>
<!-- cn:AgeType used in output message -->
<!-- ignored -->
</wsdl:definitions>
Question:
How to tell cxf-codegen wsdl2java
to do not generate code for AgeType (which is in namespace http://xmlns.common/age) and use common.xmlns.age.AgeType instead of com.person.AgeType and com.animal.AgeType in respective projects by supplying the Common
project as dependency?