2

测试了几个选项来使用 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 ) 继续失败

你们是如何设法正确生成集合的 setter 的?

谢谢!

4

0 回答 0