maven - Java: How to add suffix to generated classes by mvn cxf codegen plugin -
i want use cxf codegen plugin generate wsdl file java classes. after compile without binding file works want add prefix or suffix generated classes. configuration in pom file looks below:
<configuration> <sourceroot>src/main/java</sourceroot> <wsdlroot>${basedir}/src/main/resources/wsdl/</wsdlroot> <includes> <include>*your.wsdl</include> </includes> <wsdloptions> <wsdloption> <wsdl>${basedir}/src/main/resources/wsdl/your.wsdl</wsdl> <packagenames> <packagename>http://www.schema.org/something=info.package.p1</packagename> <packagename>info.package.p2</packagename> </packagenames> <bindingfiles> <bindingfile>${basedir}/src/main/resources/bindingfile.xjb</bindingfile> </bindingfiles> </wsdloption> </wsdloptions> </configuration>
my wsdl file contains following:
<s:schema elementformdefault="qualified" targetnamespace="http://www.schema.org/p2"> <s:include schemalocation="../xsd/one.xsd"/> <s:include schemalocation="../xsd/two.xsd"/> ...etc...
my bindingfile.xjb looks below:
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jxb:version="2.0"> <jxb:bindings schemalocation="../xsd/one.xsd" node="/xs:schema"> <jxb:schemabindings xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"> <jxb:namexmltransform> <jxb:elementname suffix="_one"/> <jxb:typename suffix="_one"/> <jxb:anonymoustypename suffix="_one"/> </jxb:namexmltransform> </jxb:schemabindings> </jxb:bindings> </jxb:bindings>
when tried compile source got following error:
/xsd/one.xsd not part of compilation
when remove wsdl file following line:
<s:include schemalocation="../xsd/two.xsd"/>
it works properly. question how can make binding file globally includes xsd files , adds of them suffix or prefix. or there configuration can specify in pom file?
Comments
Post a Comment