如何使用Maven jaxws-maven-plugin通过映射文件从wsdl生成类

我正在将现有应用程序从ant build迁移到Maven。

我使用jaxws-maven-plugin从wsdl文件生成类,但是所有类都在与映射到war文件中的文件夹相同的文件夹内生成。有一个映射XML文件,但我不知道如何在插件中将映射文件作为参数传递。

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.9</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals><goal>add-source</goal></goals>
                    <configuration>
                        <sources>
                            <source>${project.build.directory}/generated/src/main/java</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.12</version>
            <configuration>
                <wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
                <packageName>com.org.Project1.xsd</packageName>
                <wsdlFiles>
                    <wsdlFile>Project1.wsdl</wsdlFile>
                </wsdlFiles>
                <keep>true</keep>
                <sourceDestDir>${project.build.directory}/generated/src/main/java</sourceDestDir>
            </configuration>
            <executions>
                <execution> 
                    <id>myImport</id>
                    <goals><goal>wsimport</goal></goals>
                </execution>
            </executions>
        </plugin>
    </plugins>        
</build>
simonfeng88 回答:如何使用Maven jaxws-maven-plugin通过映射文件从wsdl生成类

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1462593.html

大家都在问