Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CXF offers some extensions for the code generation which can be activated by adding them as dependencies.. They have to be added as depdendencies and then activated by using an extraarg with content -xjc-X<extension id>

artifact id

description

extension id

cxf-xjc-boolean

Adds getters for booleans

boolean

cxf-xjc-bug671

Workaroung for JAXB bug 671

bug671

cxf-xjc-dv

Default value support

dv

cxf-xjc-ts

Adds toString to objects

ts

cxf-xjc-wsdlextension

WsdlExtension support

wsdlextension

Code Block
xml
xml
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
  <execution>
    <id>generate-sources</id>
    <phase>generate-sources</phase>
    <configuration>
      <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
      <wsdlOptions>
        <wsdlOption>
          <wsdl>${basedir}/src/test/resources/org/apache/camel/converter/jaxb/soap/CustomerService.wsdl</wsdl>
          <extraargs>
            <extraarg>-xjc-Xts</extraarg>
          </extraargs> 
        </wsdlOption>
      </wsdlOptions>
    </configuration>
    <goals>
      <goal>wsdl2java</goal>
    </goals>
  </execution>
</executions>
<dependencies>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-xjc-ts</artifactId>
        <version>${cxf.version}</version>
     </dependency>
</dependencies>
</plugin>