0

如何在我的 POM.xml 中使用 wsimport -clientjar。我希望这会下载 java 源代码,从中创建 Jar 并删除源代码。

你能给我一个示例 POM 吗?谢谢你。

4

2 回答 2

0

我知道这是一个老问题,但如果其他人正在寻找,
我正在使用这个 pom 进行测试:

    <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.xerox.3dprinterfarm</groupId>
    <artifactId>3DPrinterInterfaceTests</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>3D Printer Interface Tests</name>
    <description>3D Printer Interface Tests</description>

    <build>  
    <plugins>           
        <!-- use the jax-ws maven plugin-->
        <plugin> 
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.12</version>
            <executions> 
                <execution> 
                    <id>wsimport-from-jdk</id>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <!-- using wsdl from an url -->
                <wsdlUrls>
                    <wsdlUrl>
                        https://webservices.xerox.com/3dPrints?WSDL
                    </wsdlUrl>
                </wsdlUrls>
                <!-- or using wsdls file directory -->
                    <!-- <wsdlDirectory>src/wsdl</wsdlDirectory> -->
                <!-- which wsdl file -->
                <!-- <wsdlFiles> -->
                    <!-- <wsdlFile>myWSDL.wsdl</wsdlFile> -->
                <!--</wsdlFiles> -->
                <!-- Keep generated files -->
                <keep>true</keep> 
                <!-- Package name --> 
                <packageName>com.xerox.3dprinterfarm</packageName> 
                <!-- generated source files destination-->
                <sourceDestDir>target/generatedclasses</sourceDestDir>
            </configuration>
        </plugin>
    </plugins>  
</build>  
    <dependencies>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
</project>
于 2018-09-18T20:01:37.923 回答
-1

看看JAX-WS Maven 插件

于 2013-11-01T12:46:13.590 回答