如何使用axis2-wsdl2code-maven-plugin设置-Euwc param?

TMa*_*Man 5 autoboxing axis2 wsdl2code maven

我们正在使用axis2来生成Web服务客户端(我现在后悔!).使用axis2命令行工具,您可以将switch -Euwc传递给Integer,将boolean传递给Boolean,以及生成的soruces等等.这是告诉axis2 可以使某些int或boolean值在模式中可以为空的一种方法.

我的问题是如何通过POM或Maven的其他方式设置此参数以实现与生成源相同的行为?我的stackoverflow和谷歌搜索没有太多揭示.有一个Jira问题,似乎被开发人员关闭而没有指向正确的方向.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.futile.bizzareservice</groupId>
<artifactId>BizzareService</artifactId>
<version>2.0</version>
<name>BizzareService</name>
<properties>
    <wsdl.location>unfortunate-wsdls</wsdl.location>
    <axis2.version>1.5.4</axis2.version>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
            <version>${axis2.version}</version>
            <configuration>                 
                <packageName>com.futile.bizzareservice.client</packageName>
                <wsdlFile>${wsdl.location}/bizzareservice.wsdl</wsdlFile>
                <language>java</language>
                <databindingName>adb</databindingName>
                <unpackClasses>true</unpackClasses>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>wsdl2code</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>${axis2.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>${axis2.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb-codegen</artifactId>
        <version>${axis2.version}</version>
    </dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

在配置中将unwrap设置为true无济于事,因为它们是一个不同的选项.我将来会避免使用axis2,但暂时我们会坚持使用它.

小智 6

经过长时间的冥想,我找到了解决方案:插入

<options>
    <uwc>true</uwc>
</options>
Run Code Online (Sandbox Code Playgroud)

在配置部分.