Maven相当于AntCall

时间:2016-05-25 14:04:48

标签: maven

我有一个POM文件,我使用类似的配置为几个文件调用wsimport:

<project>

    <build>
        <plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <configuration>
                ...
            </configuration>
            <executions>

                <execution>
                    <id>client.controlevagas</id>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <packageName>${wsdl.package.basic}.client.controlevagas</packageName>
                        <wsdlFiles>
                            <wsdlFile>${wsdl.dir}/ControleVagasWebService.wsdl</wsdlFile>
                        </wsdlFiles>
                        <wsdlLocation>/${wsdl.base}/ControleVagasWebService.wsdl</wsdlLocation>
                    </configuration>
                </execution> 

                <execution>
                    <id>client.downloadservice</id>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <packageName>${wsdl.package.basic}.client.downloadservice</packageName>
                        <wsdlFiles>
                            <wsdlFile>/${wsdl.dir}/DownloadService.wsdl</wsdlFile>
                        </wsdlFiles>
                        <wsdlLocation>/${wsdl.base}/DownloadService.wsdl</wsdlLocation>
                    </configuration>
                </execution>

            </executions>

        </plugin>

    </build>

</project>

执行被调用超过20次。显然它会重演。那么有没有办法让它变得更好?可能使用与AntCall类似的内容?或者某种宏

1 个答案:

答案 0 :(得分:0)

我会依赖于您的架构,具有20个不同的模块,其中包含20个不同wsdl文件的生成因为它们的意图不同(我假设如此)。分离关注点。

此外,iterator-maven-plugin可能值得一看。我不确定它是否能解决你的问题。

除此之外,我会看一下jaxws-maven-plugin