Maven JAX-WS WSGEN“未找到类错误”

时间:2012-03-23 18:53:53

标签: java maven jax-ws wsgen

当我尝试编译我的程序时。我收到以下错误消息:

Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:wsgen (generate-wsdl) on project SimpleWebServices: Error executing: wsgen [-keep, -s, etc..........

所以,我开始探索并进一步提出错误,我看到了:

Class not found: "com.test.ws.services.SimpleServiceImpl"

看起来由于某种原因,WSGEN无法找到我的价值。有没有人有任何想法?

如果感兴趣,这是我的POM ......

        <plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <id>generate-wsdl</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>wsgen</goal>
                    </goals>
                    <configuration>
                        <sei>com.test.ws.services.SimpleServiceImpl</sei>
                        <genWsdl>true</genWsdl>
                        <verbose>true</verbose>
                    </configuration>
                </execution>
            </executions>
        </plugin>

用户编辑: 我想我得到了它(根据@Thomas的建议)。看来我没有在POM Build区域中指定源文件夹。导致我的源未被编译。

添加:

<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>

我的诀窍。

@Thomas如果你发表你的答案,我很乐意给你答复。

感谢您的回复,

1 个答案:

答案 0 :(得分:1)

只需使用

mvn clean compile jaxws:wsgen

而不是

mvn clean jaxws:wsgen

问题是,没有可用的编译版本。 wsgen将用于类路径,例如带有ByteCode的JAR。

sourceDirectory ${project.basedir}/src/main/java是maven默认值,因此您无需进行必要设置。