当我尝试编译我的程序时。我收到以下错误消息:
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 如果您发布答案,我很乐意给予您答案信用。
感谢您的回复,
最佳答案
直接使用
mvn clean compile jaxws:wsgen
而不是
mvn clean jaxws:wsgen
问题是,没有可用的编译版本。 wsgen
适用于类路径,例如带有 ByteCode 的 JAR。
sourceDirectory
${project.basedir}/src/main/java
是maven默认的,所以你不必设置它。
关于java - Maven JAX-WS WSGEN "Class not found error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9844938/