This plugin is just a fancy wrapper around xjc.
There are two xjc plugins that address your problem space:
- Value-constructor exactly what you are looking for.
- Fluent-api not exactly what you are looking for, but many prefer a fluent api to value constructors.
You need to add the required dependencies and then configure the plugin to enable those plugins in xjc, e.g.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<configuration>
<defaultOptions>
<extraargs>
<extraarg>-xjc-Xvalue-constructor</extraarg>
</extraargs>
</defaultOptions>
</configuration>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-value-constructor</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.4</version>
</dependency>
</dependencies>
</plugin>
Note: the above makes this a default for all executions, if you want to enable those options for a specific execution only, then just add the <configuration>
bit into that specific execution.