测试了一些选项,可以使用CXF从wsdl2java生成集合上的setter。
<execution>
<goals>
<goal>wsdl2java</goal>
</goals>
<id>generate-jaxb</id>
<phase>generate-sources</phase>
<configuration>
<additionalJvmArgs>-Dfile.encoding=UTF8</additionalJvmArgs>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/ScAssetMgmtDalet_inbound.wsdl</wsdl>
<extraargs>
<extraarg>-b</extraarg>
<extraarg>${basedir}/src/main/resources/wsdl/jaxws-bindings.xml</extraarg>
<extraarg>-exsh</extraarg>
<extraarg>true</extraarg>
<extraarg>-Xfluent-api-ext</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>2.2.4-1</version>
</plugin>
<plugin>
<groupId>net.java.dev.vcc.thirdparty</groupId>
<artifactId>collection-setter-injector</artifactId>
<version>0.5.0-1</version>
</plugin>
<plugin>
<groupId>redmosquito</groupId>
<artifactId>jaxb-fluent-api-ext</artifactId>
<version>0.0.1</version>
</plugin>
</plugins>
</configuration>
</execution>
还尝试了
<extraarg>-xjc-Xsetters</extraarg>
或
<extraarg>-xjc-Xcollection-setter-injector</extraarg>
没有更多的运气。使用BadUsageException(jaxb-fluent-api-ext)或BadCommandException(jaxb XJC)继续失败
你们是如何设法正确生成你的收藏品的?[/ p>]
谢谢!