Hello,
I'm trying to use the JAXB2 'toString plugin', the 'fluent-api pluging' and the
'defaultValue plugin' with the maven cxf-codegen-plugin.
ToString and fluent-api are working fine, but the defaultValue plugin seems to
do nothing. I'm using the following pom.xml (fragment).
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.2.7</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/TrafficMessageManagement.wsdl</wsdl>
<dependencies>
<dependency>${basedir}/src/main/resources/wsdl/TrafficMessageManagement.xsd</dependency>
</dependencies>
<extraargs>
<extraarg>-client</extraarg>
<extraarg>-xjc-Xts</extraarg>
<extraarg>-xjc-Xdv</extraarg>
<extraarg>-xjc-Xfluent-api</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>2.2.7</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-dv</artifactId>
<version>2.2.7</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.java.dev.jaxb2-commons</groupId>
<artifactId>jaxb-fluent-api</artifactId>
<version>2.1.8</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
Following code has been generated:
@XmlElement(required = true)
protected String tagName;
@XmlElement(required = true)
protected String value;
@XmlElement(required = true)
protected StringComparator comparator;
@XmlElement(defaultValue = "false")
protected boolean caseSensitiv;
I expected that it should be
protected boolean caseSensitiv=false;
What went wrong ?
By the way. Is there a way to use other JAXB2 Plugins like the 'Equals plugin'
or the 'HashCode plugin'
Regards,
Jürgen