使用jaxws-maven-plugin时遇到问题没有错误但没有生成类

时间:2013-12-11 15:27:09

标签: java jax-ws maven-plugin webservice-client

我在java项目中使用Web服务。我选择了maven jaxws-maven-plugin。我已按照jax-ws-common usage page上的教程进行操作。下面是我的pom

 <groupId>org.somecompany</groupId>
 <artifactId>producta-java-connector</artifactId>
 <version>1.0-SNAPSHOT</version>
 <packaging>jar</packaging>

 <name>producta-java-connector</name>
 <url>http://maven.apache.org</url>

 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>

 <dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.2.8</version>
    </dependency>
 </dependencies>

<build>
    <plugins>
        <plugin>
        <groupId>org.jvnet.jax-ws-commons</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.3</version>
        <executions>
            <execution>
                <id>generate-service-client</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>wsimport</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <keep>true</keep>
            <wsdlLocation>http://go.producta.com/ws/service?wsdl</wsdlLocation>
            <staleFile>${project.build.directory}/jaxws/stale/service.stale</staleFile>
            <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
            <packageName>org.somecompany.producta.api.proxy.generated</packageName>
            <wsdlDirectory>${project.build.directory}/wsdl</wsdlDirectory>
            <!--<wsdlFiles>-->
                <!--<wsdlFile>go.producta.com/ws/service.wsdl</wsdlFile>-->
            <!--</wsdlFiles>-->
        </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                          <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
                        <silent>true</silent>
                        <artifactItems>
                            <artifactItem>
                                <groupId>javax.xml.bind</groupId>
                                <artifactId>jaxb-api</artifactId>
                                <version>2.2.7</version>
                                <type>jar</type>
                            </artifactItem>
                            <artifactItem>
                                <groupId>javax.xml.ws</groupId>
                                <artifactId>jaxws-api</artifactId>
                                <version>2.2.9</version>
                                <type>jar</type>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
             </executions>
           </plugin>
        </plugins>
    </build>

</project>

项目本身构建正常,wsimport也运行正常,没有任何错误,只是没有生成类。我现在很困惑。

任何人都可以看到我没看到的错误吗?

谢谢

1 个答案:

答案 0 :(得分:0)

不相关但是,基于对此问题观察到的沉默,我尝试了cxf客户端cxf-codegen-plugin。它非常简单,并在第一次尝试时工作。所以我会坚持这个。

由于