0

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

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 构建区域中指定源文件夹。导致我的源代码没有被编译。

添加:

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

为我做了诀窍。

@Thomas 如果您发布答案,我很乐意为您提供答案。

感谢您的回复,

4

1 回答 1

1

只需使用

mvn clean compile jaxws:wsgen

代替

mvn clean jaxws:wsgen

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

sourceDirectory ${project.basedir}/src/main/java是 maven 默认的,所以你不必设置它。

于 2013-02-25T13:14:02.863 回答